Managed to find the library using GH after all.

It seems that Windows installs all the libraries in the same SYSTEM
directory, using a version suffix for non-default ones.
e.g. the default is libcrypto.dll, whereas an additional one might be
libcrypto-1_1-x84.dll.

[I'm working on updates to the code to allow the alternate name to be used.]

On Thu, 2 Nov 2023 at 01:28, sebb <seb...@gmail.com> wrote:
>
> I don't currently have ready access to a Windows host, and have so far
> failed to find the correct setting of jn[ai].library.path required to
> cause OpenSSL to be loaded rather than the default which seems to be
> LibreSSL.
>
> So if anyone with Windows and OpenSSL 1.1.x can help that would be great!
>
> The following command can be used to load the library via JNI:
>
> mvn -q exec:java -D"exec.mainClass=org.apache.commons.crypto.Crypto"
> -D"jni.library.path=<path to openssl lib>"
>
> Try it first without the jni.library.path define, and it should show
> the default library details.
>
> To find the path setting on macOS one can use the output from:
> $ openssl version -e
> ENGINESDIR: "/usr/local/lib/engines-1.1"
> The setting for jni.library.path on macOS is the ENGINESDIR without
> the 'engines-1.1' part.
> i.e. /usr/local/lib in this case.
>
> But my attempts to try the same approach using GH actions have so far failed.
> It always loads the default library.
>
> For loading via JNA, one can use the following to show the library details:
> mvn -q exec:java
> -D"exec.mainClass=org.apache.commons.crypto.jna.OpenSslJna"
> -D"jna.library.path=<path to lib>" (note the slightly different
> property name)
>
> The same path works for both JNI and JNA on macOS; I expect this will
> also be true on Windows.
>
> Note: to build the code, I've found the quickest is to use:
>
> mvn [clean] test -DskipTests
>
> This ensures the native files are built.
>
> Sebb

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to