Results 1 to 13 of 13

Thread: run-time vs linked OpenSSL support

  1. #1
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default run-time vs linked OpenSSL support

    What's the difference between run-time and linked OpenSSL support when building Qt?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: run-time vs linked OpenSSL support

    Resolving OpenSSL libs dynamically at run-time when needed vs. linking to OpenSSL libs when building Qt. The former is much more dynamic - the latter requires that the necessary libs are present also when deployed or the app won't run.
    J-P Nurmi

  3. #3
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: run-time vs linked OpenSSL support

    Quote Originally Posted by jpn View Post
    Resolving OpenSSL libs dynamically at run-time when needed vs. linking to OpenSSL libs when building Qt. The former is much more dynamic - the latter requires that the necessary libs are present also when deployed or the app won't run.
    I'm still confused. Are we talking about dynamic vs static linking?

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: run-time vs linked OpenSSL support

    No, we are talking about linking versus loading a shared library at runtime (ie. QLibrary).
    J-P Nurmi

  5. #5
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: run-time vs linked OpenSSL support

    Quote Originally Posted by jpn View Post
    No, we are talking about linking versus loading a shared library at runtime (ie. QLibrary).
    Linking versus loading on Windows?
    Either you link with a static library meaning you incorporate its code into your code or you link with a dynamic library and then load dll file at run-time...

    Am I missing something?

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: run-time vs linked OpenSSL support

    I'm not referring to dynamic or static linking in particular, I'm just talking about linking in general.

    It is possible to access a shared library without linking, via dlopen() on *nix and something else on Windows I suppose (QLibrary hides this). The idea is to load the shared library at runtime and resolve exported symbols on the fly. This way the program can be run with or without the shared library. Resolving will just fail if the library doesn't exist, and the particular feature can be left out. But if you link to a library, the library needs to exist in order to launch the application.
    J-P Nurmi

  7. The following user says thank you to jpn for this useful post:

    piotr.dobrogost (17th July 2009)

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: run-time vs linked OpenSSL support

    In other words linked approach requires you to ship OpenSSL libraries even if your application doesn't use SSL. Run-time dependency means OpenSSL is treated as a plugin and loaded when needed.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #8
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: run-time vs linked OpenSSL support

    I always thinking what -opensll-linked must incapsulate all OpenSLL code into QtNetwork4.dll and not have dependencies for libeay32.dll or something else. So if its wrong, we want third key for configure - -openssl-static for example.

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: run-time vs linked OpenSSL support

    Quote Originally Posted by SABROG View Post
    So if its wrong, we want third key for configure - -openssl-static for example.
    You don't need such a key, just build OpenSSL in static mode and make sure it comes before the dynamic one in library lookup path.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #10
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: run-time vs linked OpenSSL support

    Quote Originally Posted by wysota View Post
    You don't need such a key, just build OpenSSL in static mode and make sure it comes before the dynamic one in library lookup path.
    Which in case of Windows is just PATH as there's no such thing like special library lookup path on Windows, right?

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: run-time vs linked OpenSSL support

    Quote Originally Posted by piotr.dobrogost View Post
    Which in case of Windows is just PATH as there's no such thing like special library lookup path on Windows, right?
    I meant the -L switch to gcc/MinGW.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #12
    Join Date
    Mar 2012
    Location
    India
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question Re: run-time vs linked OpenSSL support

    Hi All,

    I am new in Qt programming, i need your help to resolve an issue.
    I want to display certificate information of secured website in "Qt demo brower", for this i write code to display but i am unable to get "defaultCaCertificate", "caCertificate" and "peerCertificateChain".
    Do we need any type of initilization before using these APIs ?

    Every time when i call below code it retrive 0 items in dCaCertificates.
    QList<QSslCertificate> dCaCertificates = QSslSocket::defaultCaCertificates();

    But i am able to get system certificates using below code:
    QList<QSslCertificate> sysCertificates = QSslSocket::systemCaCertificates();

    Please help me, its urgent.

    Regards,
    Pranay

  14. #13
    Join Date
    Mar 2012
    Location
    India
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: run-time vs linked OpenSSL support

    Hi Pranay,

    If you want to get and display certificate details in Qt demo browser, here is the code:
    First of all to peerCertificateChain details, one can use the SLOT sslError, the argument within this SLOT named QNetworkReply have all the details of peerCertificateChain and peerCertificate.

    void NetworkAccessManager::sslError(QNetworkReply *reply, const QList<QSslError> &error)
    {
    QList<QSslCertificate> peerCertificateChain = reply->sslConfiguration().peerCertificateChain();
    }

    Thanks & Regards,
    Software

Similar Threads

  1. Qt 4.4.3 commercial on Kubuntu 8.10
    By Micawber in forum Installation and Deployment
    Replies: 5
    Last Post: 17th February 2010, 02:02
  2. Qt for Windows CE with OpenSSL support
    By Jonas in forum Installation and Deployment
    Replies: 2
    Last Post: 4th February 2010, 08:36
  3. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 08:18
  4. Qt-4.4.0 installation error in linux
    By babu198649 in forum Installation and Deployment
    Replies: 4
    Last Post: 27th May 2008, 15:35
  5. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 10:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.