Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-4343

QSSLSocket: OpenSSL library naming is inconsistent

    XMLWordPrintable

Details

    Description

      libssl32.lib is generated when OpenSSL is built using MinGW. Qt looks for the library using the name ssleay32.lib and so it doesn't load. A small change would resolve this and allow both name versions to work:

      Qt sources, specially, src/network/ssl/qsslsocket_openssl_symbols.cpp.
      Around line 320 you'll find:

      1. ifdef Q_OS_WIN
        QLibrary *ssleay32 = new QLibrary(QLatin1String("ssleay32"));
        if (!ssleay32->load()) { // Cannot find ssleay32.dll delete ssleay32; return pair; }

      The problem is when OpenSSL is compiled with MinGW the resulting dll
      is named libssl32.dll. So I suggest teh code is changed so...

      QLibrary *ssleay32 = new QLibrary(QLatin1String("ssleay32"));
      if (!ssleay32->load()) {
      // Cannot find ssleay32.dll
      delete ssleay32;

      //############
      //before
      //return pair;
      //############

      //############
      //now
      sleay32 = new QLibrary(QLatin1String("libssl32"));
      if (!ssleay32->load())

      { // Cannot find libssl32.dll delete ssleay32; return pair; }

      //############
      }

      I was not able to reproduce this myself - my own OpenSSL generates the library with both names, apparently to retain backward compatibility with dependent applications.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stormols Marius Storm-Olsen
            cattell Matthew Cattell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes