Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

linux - How to tell Qt to use different OpenSSL

I have linux with Qt 4:4.6.3-4+squeeze1 and openssl 0.9.8o-4squeeze14 There is problem with communication between openssl.0.9.8 and openssl 1.0 described here:

Running curl with OpenSSL 0.9.8 against OpenSSL 1.0.0 server causes handshake error?

http://marc.info/?l=openssl-dev&m=136760073921954&w=2

I have built openssl-1.0.2j to /home/openssl but I can't make Qt using this library. SSL is dynamically linked so ldd my_program doesn't show libssl. I have tried

LD_LIBRARY_PATH=/home/openssl ./my_program

But it doesnt work, I can see with command:

$ lsof -p 16126|grep -i ssl
ccbox-ccd 16126 root  mem    REG       80,5   310296  8389597 /usr/lib/i686/cmov/libssl.so.0.9.8
$ lsof -p 16126|grep -i crypt
ccbox-ccd 16126 root  mem    REG       80,5   469632 29365978 /usr/lib/libgcrypt.so.11.5.3
ccbox-ccd 16126 root  mem    REG       80,5   143180 29375951 /usr/lib/libk5crypto.so.3.1
ccbox-ccd 16126 root  mem    REG       80,1    38360  1104731 /lib/i686/cmov/libcrypt-2.11.3.so
ccbox-ccd 16126 root  mem    REG       80,5  1393308  8389598 /usr/lib/i686/cmov/libcrypto.so.0.9.8

that it is always using 0.9.8 also editing /etc/ld.so.conf doesn't help

How to point Qt to use never version of openssl

Best Regards Marek

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

it's better if you can rebuild your application (using qmake/make), and make sure that you use the right openssl libs by running

export LD_LIBRARY_PATH=Absolute_Path/openssl/lib

before building.

Also, you can use the same command before running your app, even if your app was build using openssl libs at different location. However, you need to make sure that the names of the openssl libs at the new location match the ones that your application needed as per your ldd output.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...