PDA

View Full Version : Use openssl 1.0.0 with Qt 4.8.3 on Mac



sfcheng77
23rd November 2012, 16:12
When I use openssl 0.9.8 with my qtwebkit-based application built with Qt 4.8.3, I got a lot of ssl errors. If I use openssl 1.0.0, there are no errors. However, Mac only comes with openssl 0.9.8 and 0.9.7 by default. No openssl 1.0.0 is included in the default installation. Therefore, I would like to deploy libssl.1.0.0.dylib within my application bundle. Qt loads the ssl library dynamically with mac API dlopen. Therefore, it only searches the path given in LD_LIBRARY_PATH. I know I could create a shell script to launch the application with modified LD_LIBRARY_PATH (That's how people deploy apps on linux). But it doesn't seem to be the standard practice on mac. I don't want to install the openssl 1.0.0 into the system path either.

Please advise what is the best way to solve this problem.

ChrisW67
23rd November 2012, 23:01
I thought this was the sort of problem that private frameworks in Mac bundles addressed. Make OpenSSL a private framework and adjust the bundle's search path. See the Mac deployment docs.

sfcheng77
24th November 2012, 00:26
The QT Mac deployment doc only talks about libraries with link information embedded at compile time, such as qt framework and the plugins. For those libraries, we can use the install_name_tool to change the path of the libraries to relative paths so that the executable can locate the supporting libraries properly after deployment. However, openssl is loaded at run time with no embedded link information. I am not a mac newbie and don't know how to help my app locate the library properly at run time in this case.



I thought this was the sort of problem that private frameworks in Mac bundles addressed. Make OpenSSL a private framework and adjust the bundle's search path. See the Mac deployment docs.