Lazarus using Indy + OpenSSL on OS X results in EIdOSSLCouldNotLoadSSLLibrary

ⅰ亾dé卋堺 提交于 2019-12-12 03:28:36

问题


I am currently using:

  • OS X Yosemite 10.10.5
  • newest Indy (10.6.2.0, download 2016 March 13 - Indy10_5346.zip)
  • Lazarus 1.4.4
  • newest openssl

OpenSSL is more specificly:

  • openssl-1.0.2g accordingly to home brew cmd line interface
  • placed in /usr/local/Cellar/openssl/1.0.2/lib/
  • lib files in above directory are: libcrypto.10.dylib, libcrypto.1.0.0.dylib, libcrypto.dylib, libcrypto.a, libssl.1.0.0.dylib, libssl.dylib, libssl.a

...

I am passing above pah to Indy using idOpenSSLSetLibPath() befoe using Indy.

but I am getting getting error: EIdOSSLCouldNotLoadSSLLibrary at:

TIdSSLIOHandlerSocketOpenSSL.Init() -> TIdSSLContext.Create()
...
LoadOpenSSLLibrary() -> IdSSLOpenSSLHeaders.Load()
...
Load()
...
hIDCrypto := LoadSSLCryptoLibrary() -> Result := HModule(HackLoad(...))
...
Result := LoadLibrary(HackLoadFileName(ALibName,ALibVersions[I])); // always zero :(

Comments

  • "GIdOpenSSLPath + SSLCLIB_DLL_name are correct (file extension set correctly by Indy when using "HackLoadFileName" in "LoadLibrary" call)

  • Indy tries to iterate/load over following names: libcrypto, libcrypto.1.0.0, libcrypto.10, libcrypto.1.0.1, libcrypto.1.0.2

...

Side question #1:

  • why does homebrew ship openssl 1.0.2g in a file called libcrypto.1.0.0.dylib - is it to maximize compability?

...

Thoughts on possible cause #1:

Could all this be an issue of Lazarus compiles 32bit for OS X? And OpenSSL is 64bit?


回答1:


Install openssl like this in command line: brew install openssl --universal

This ensure the library works both for 32 and 64 bit apps.

You may need to uninstall first using: brew uninstall openssl



来源:https://stackoverflow.com/questions/35978851/lazarus-using-indy-openssl-on-os-x-results-in-eidosslcouldnotloadssllibrary

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!