Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. SSL Configuration for Linux Steps
Forum Updated to NodeBB v4.3 + New Features

SSL Configuration for Linux Steps

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 3.2k Views 3 Watching
  • 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.
  • A Offline
    A Offline
    Alex94102
    wrote on 27 Jul 2018, 04:49 last edited by
    #1

    Is there an official step by step guide for enabling SSL in Linux? If not what are the high level steps?

    I am trying to run some code that uses HTTPS but I get the following error:

    QDEBUG : TestHttpHelper::testGetCookies() SSL version used for build SSL version use for build "OpenSSL 1.0.2k-fips 26 Jan 2017"
    QDEBUG : TestHttpHelper::testGetCookies() SSL version used for run-time 0
    QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
    QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
    QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
    QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    QWARN : TestHttpHelper::testGetCookies() We got a connection error when networkLayerState is Unknown
    QNetworkReply::NetworkError(UnknownNetworkError)

    A 1 Reply Last reply 27 Jul 2018, 05:48
    0
    • A Alex94102
      27 Jul 2018, 04:49

      Is there an official step by step guide for enabling SSL in Linux? If not what are the high level steps?

      I am trying to run some code that uses HTTPS but I get the following error:

      QDEBUG : TestHttpHelper::testGetCookies() SSL version used for build SSL version use for build "OpenSSL 1.0.2k-fips 26 Jan 2017"
      QDEBUG : TestHttpHelper::testGetCookies() SSL version used for run-time 0
      QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
      QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
      QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
      QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
      QWARN : TestHttpHelper::testGetCookies() qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
      QWARN : TestHttpHelper::testGetCookies() We got a connection error when networkLayerState is Unknown
      QNetworkReply::NetworkError(UnknownNetworkError)

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 27 Jul 2018, 05:48 last edited by
      #2

      Hi @Alex94102,

      it seems Qt was build for OpenSSL 1.0.2k

      Which OpenSSL do you have on your system?

      Please note that OpenSSL 1.1 is incompatible to 1.0.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • A Offline
        A Offline
        Alex94102
        wrote on 27 Jul 2018, 18:37 last edited by
        #3

        Hi Aha_1980,

        I have: openssl (1.1.0g-2ubuntu4.1)

        I also tried building and installing 1.0 but no luck. Even if I specify the library in the project itself (ssl and crypto) Is there something that needs to be configured in a specific way? I am really looking for some good documentation

        thank you,
        alex

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Alex94102
          wrote on 27 Jul 2018, 18:53 last edited by
          #4

          Update:

          I build openssl-1.0.2o into /opt/openssl-1.0.2o using the "shared" option (when you run ./config

          then I added the following lines to my project:

          LIBS += -L/opt/openssl-1.0.2o/ -llibssl
          LIBS += -L/opt/openssl-1.0.2o/ -llibcrypto

          it works, but isn't this an ugly solution? Do I need to put this in every single project? can this pick up the system openssl libraries automatically? I think there has to be a cleaner way to get this to work.

          Thank you,
          alex

          A 1 Reply Last reply 27 Jul 2018, 19:02
          0
          • A Alex94102
            27 Jul 2018, 18:53

            Update:

            I build openssl-1.0.2o into /opt/openssl-1.0.2o using the "shared" option (when you run ./config

            then I added the following lines to my project:

            LIBS += -L/opt/openssl-1.0.2o/ -llibssl
            LIBS += -L/opt/openssl-1.0.2o/ -llibcrypto

            it works, but isn't this an ugly solution? Do I need to put this in every single project? can this pick up the system openssl libraries automatically? I think there has to be a cleaner way to get this to work.

            Thank you,
            alex

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 27 Jul 2018, 19:02 last edited by aha_1980
            #5

            Hi @Alex94102,

            I can only tell you my knowledge - which is rather limited in that area:

            • OpenSSL 1.0 and 1.1 are binary incompatible
            • Qt 5.11 can be compiled to use OpenSSL 1.1, but uses 1.0 by default
            • The linker will pick up the system libraries (under /lib and /usr/lib) first by default, which is 1.1 I guess?

            So what you did looks like an hack but I can't see a really clean solution at the moment (except building Qt 5.11 from source with OpenSSL 1.1 support). Maybe someone else has an idea...

            Which Qt version are you using? And which OS is this?

            Qt has to stay free or it will die.

            A 1 Reply Last reply 27 Jul 2018, 20:38
            0
            • A aha_1980
              27 Jul 2018, 19:02

              Hi @Alex94102,

              I can only tell you my knowledge - which is rather limited in that area:

              • OpenSSL 1.0 and 1.1 are binary incompatible
              • Qt 5.11 can be compiled to use OpenSSL 1.1, but uses 1.0 by default
              • The linker will pick up the system libraries (under /lib and /usr/lib) first by default, which is 1.1 I guess?

              So what you did looks like an hack but I can't see a really clean solution at the moment (except building Qt 5.11 from source with OpenSSL 1.1 support). Maybe someone else has an idea...

              Which Qt version are you using? And which OS is this?

              A Offline
              A Offline
              Alex94102
              wrote on 27 Jul 2018, 20:38 last edited by
              #6

              @aha_1980 said in SSL Configuration for Linux Steps:

              Which Qt version are you using? And which OS is this?

              Linux Mint 19, and Qt 5.11.1

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on 27 Jul 2018, 20:56 last edited by
                #7

                Hi,

                Doesn't Mint provide both versions of OpenSSL ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                A 1 Reply Last reply 28 Jul 2018, 21:07
                1
                • SGaistS SGaist
                  27 Jul 2018, 20:56

                  Hi,

                  Doesn't Mint provide both versions of OpenSSL ?

                  A Offline
                  A Offline
                  Alex94102
                  wrote on 28 Jul 2018, 21:07 last edited by
                  #8

                  Hello @SGaist

                  1. Ok, I was not able to install openssl 1.0 using the synaptic, or apt. Pretty much I run into dependencies and broken packages issues--it didn't work.

                  2. Now, I found a very good article:
                    https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/

                  and after replacing the default 1.1 with 1.0 it worked perfectly. I removed my project openssl references "LIBS" and Qt was able to now pick up the default system level openssl libraries.

                  Thanks a lot for the hint!! :-)

                  Pablo J. RoginaP 1 Reply Last reply 30 Jul 2018, 13:28
                  1
                  • A Alex94102
                    28 Jul 2018, 21:07

                    Hello @SGaist

                    1. Ok, I was not able to install openssl 1.0 using the synaptic, or apt. Pretty much I run into dependencies and broken packages issues--it didn't work.

                    2. Now, I found a very good article:
                      https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/

                    and after replacing the default 1.1 with 1.0 it worked perfectly. I removed my project openssl references "LIBS" and Qt was able to now pick up the default system level openssl libraries.

                    Thanks a lot for the hint!! :-)

                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on 30 Jul 2018, 13:28 last edited by
                    #9

                    @Alex94102 if your issue is solved, please don't forget to mark your post as such. Thanks

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    1 Reply Last reply
                    0

                    1/9

                    27 Jul 2018, 04:49

                    • Login

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