OSX+ Java+ openssl+ org.apache.commons:commons-crypto = segfault in opensslnative:initiDs

发布于 2025-01-26 16:49:12 字数 520 浏览 3 评论 0原文

我使用了一个简单的Java类,使用Apache:Commons-Crypto进行对我的加密/解密。

在OSX上,我使用Homebrew安装了最新的OpenSSL用于使用。

追踪该问题,它发生在OpenSlnativate:initiDs JNI在某处链接本机代码。我在这里找到了C代码:

https://github.com/apache/commons-crypto/blob/master/src/src/main/native/native/org/apache/commons/cmrypto/cipher/cipher/cipher/opensslnative.c https://github.com/apache/commons-crypto/blob/master/lib/lib/include/config.h

通过代码扫描,我在OSX上找到了“ libcrypto.dylib”,引用。该库正确链接到/usr/local/opt/openssl/lib目录。

I had a simple Java class using Apache:commons-crypto to do encryption/decryption that was SegFaulting on me.

On OSX, I used Homebrew to install the latest OpenSSL to use.

Tracing down the issue, it occurred in the OpenSslNative:initIDs JNI linked native code somewhere. I found the c code here:

https://github.com/apache/commons-crypto/blob/master/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c
https://github.com/apache/commons-crypto/blob/master/lib/include/config.h

Scanning through the code, I found that on OSX, the "libcrypto.dylib" is referenced. That library was correctly linked into the /usr/local/opt/openssl/lib directory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒岛晴空 2025-02-02 16:49:12

我确信找不到libs,我更新了〜/.zshrc以添加

export dyld_library_path =“/usr/usr/local/opt/openssl/lib”

我的代码再次工作,现在可以找到库。 。

如果有一种更好的方法来完成这项工作,我将有兴趣了解它。

Confident that the libs were not found, I updated my ~/.zshrc to include

export DYLD_LIBRARY_PATH="/usr/local/opt/openssl/lib"

My code worked again now that the library could be found.

If there is a better way to make this work, I would be interested in knowing it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文