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.3k 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.
  • Alex94102A Offline
    Alex94102A Offline
    Alex94102
    wrote on 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)

    aha_1980A 1 Reply Last reply
    0
    • Alex94102A Alex94102

      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)

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 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
      • Alex94102A Offline
        Alex94102A Offline
        Alex94102
        wrote on 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
        • Alex94102A Offline
          Alex94102A Offline
          Alex94102
          wrote on 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

          aha_1980A 1 Reply Last reply
          0
          • Alex94102A Alex94102

            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

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 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.

            Alex94102A 1 Reply Last reply
            0
            • aha_1980A aha_1980

              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?

              Alex94102A Offline
              Alex94102A Offline
              Alex94102
              wrote on 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 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

                Alex94102A 1 Reply Last reply
                1
                • SGaistS SGaist

                  Hi,

                  Doesn't Mint provide both versions of OpenSSL ?

                  Alex94102A Offline
                  Alex94102A Offline
                  Alex94102
                  wrote on 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
                  1
                  • Alex94102A Alex94102

                    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 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

                    • Login

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