Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Best way to debug OpenSSL runtime linking?

Best way to debug OpenSSL runtime linking?

Scheduled Pinned Locked Moved Qt WebKit
5 Posts 2 Posters 6.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SimonHaines
    wrote on 21 Feb 2011, 06:42 last edited by
    #1

    A QWebView I'm working with in an application won't load https links, and I suspect it's because of runtime library linking with OpenSSL.

    I've built Qt on Windows with -openssl and provided the correct -I and -L flags during the build, and all went well. I've copied libeay32.dll and ssleay32.dll into the application directory, the windows\system32 directory, the windows\system directory and have even included the directory where these are originally installed to my PATH, but all to no avail.

    I'd like to have a look at Qt's debug/warning messages to find out a little more, but as I'm developing on Windows, there is no stderr for runtime debug/warning messages to print. I've tried adding CONFIG+=console to my project file, using the SysInternals application DebugView which supposedly can log messages sent to stderr, and even installed my own message handler with a breakpoint set on it, and still no Qt system messages of any kind are being logged. Have I somehow set a flag that compiles these messages out?

    So what is the best way to determine whether OpenSSL is being resolved at runtime? Alternatively, how can I access Qt's debug/warning log?
    Many thanks for advice.
    Simon Haines.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 21 Feb 2011, 11:44 last edited by
      #2

      You should run "dependency walker":http://www.dependencywalker.com/ on the target machine. It shows you, if all DLLs are available.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SimonHaines
        wrote on 21 Feb 2011, 22:15 last edited by
        #3

        Because by default Qt links the OpenSSL libraries at runtime, there is no link-time dependency. Thus dependency walker is not useful in this situation.

        What is the best way to determine whether OpenSSL is being resolved at runtime? Alternatively, how can I access Qt’s debug/warning log?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 21 Feb 2011, 22:45 last edited by
          #4

          A browser for the debug/warning log is in the wiki article "A Browser for QDebug Log Output":http://developer.qt.nokia.com/wiki/Browser_for_QDebug_output

          ssleay32.dll and libeay32.dll are the only ones that are loaded by Qt directly. In my project I do not deploy any more DLLs for SSL. Check with dependency walker, if your OpenSSL version needs more libs (special versions of the C runtime comes into mind).

          You can check if SSL support is available with "QSslSocket::supportsSsl() ":http://doc.qt.nokia.com/4.7/qsslsocket.html#supportsSsl static method.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SimonHaines
            wrote on 22 Feb 2011, 00:24 last edited by
            #5

            Thanks Volker, particularly for the debug browser link. After reading your first reply, I ran up a little test case that simply instantiated a QSslSocket and, lo and behold, somehow QT_NO_OPENSSL was defined by my configuration. I am a fool and need not have bothered you.

            Looks like I need to rebuild my Qt, after checking my configure output more carefully. As I'm rebuilding anyway, I'm going to define '-openssl-linked' and fail fast if OpenSSL can't be resolved.

            Thanks again for your time and advice.

            1 Reply Last reply
            0

            3/5

            21 Feb 2011, 22:15

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved