OSX+ Java+ openssl+ org.apache.commons:commons-crypto = segfault in opensslnative:initiDs
我使用了一个简单的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我确信找不到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.