1

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

jww
  • 97,681
  • 90
  • 411
  • 885
user2018761
  • 306
  • 5
  • 14
  • [Add OpenSSL support for Linux Qt Application](https://stackoverflow.com/q/47630402/608639), [How to Include OpenSSL in a Qt project](https://stackoverflow.com/q/14681012/608639), [Changing OpenSSL include path for qmake](https://stackoverflow.com/q/20592001/608639), [How to tell Qt to use different OpenSSL](https://stackoverflow.com/q/40429278/608639), [How to implement OpenSSL in Qt?](https://stackoverflow.com/q/43384887/608639), [Is there any way to building static Qt with static OpenSSL?](https://stackoverflow.com/q/20843180/608639), etc – jww Jan 14 '18 at 09:18

2 Answers2

1

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.

HazemGomaa
  • 1,620
  • 2
  • 14
  • 21
  • the problem is that my app isn't linked against openssl directly, ldd my_app doesn't show libcrypt or libssl, Qt is linked against openssl so it looks like I need to compile new Qt version and link it with new openssl. – user2018761 Nov 04 '16 at 22:55
  • @user2018761 what you app ldd looks like ? can you post that ? – HazemGomaa Nov 04 '16 at 23:38
0

Application ldd

ldd /home/ccbox-ccdns/ccbox-ccdns
        linux-gate.so.1 =>  (0xb7739000)
        libQtSql.so.4 => /usr/lib/libQtSql.so.4 (0xb76ef000)
        libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0xb76aa000)
        libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0xb757d000)
        libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0xb72f9000)
        libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb72e0000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb71eb000)
        libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb71c5000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb71a6000)
        libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb705f000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb704b000)
        libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7047000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7042000)
        librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb7039000)
        libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb6f6f000)
        /lib/ld-linux.so.2 (0xb773a000)
        libpcre.so.3 => /lib/libpcre.so.3 (0xb6f3c000)

And I have learned that precompiled packages with qt use dlopen to access openssl lib instead of shared lib .so thats why I can't make it to use different version of openssl. Now I'm compiling new qt with openssl

user2018761
  • 306
  • 5
  • 14