Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QSslSocket failure from Online Installer version (Ubuntu)

QSslSocket failure from Online Installer version (Ubuntu)

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 3.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.
  • A Offline
    A Offline
    acetone
    wrote on 3 Apr 2023, 17:55 last edited by
    #1

    Now Ubuntu using libssl 3.0 by default. I think Qt builded with lower versions.

    So if I try to use QSslSocket, I see this fails in console log:

    qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
    qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate
    SSL error: "The peer did not present any certificate"
    Socket error: QAbstractSocket::SocketError(13)
    

    How I can fix this with minimal pain?

    Thanks.

    S 1 Reply Last reply 3 Apr 2023, 18:43
    0
    • A Offline
      A Offline
      acetone
      wrote on 7 Apr 2023, 06:22 last edited by
      #7

      Solved by manual linking with openssl1 and ssl1.

      1. Download old openssl sources:
      wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
      
      1. Compile:
      tar -xf openssl-1.1.1q.tar.gz
      cd openssl-1.1.1q
      ./config
      make
      
      1. Add to project:
      # .pro file:
      LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
      
      D 1 Reply Last reply 30 May 2023, 07:45
      1
      • A acetone
        3 Apr 2023, 17:55

        Now Ubuntu using libssl 3.0 by default. I think Qt builded with lower versions.

        So if I try to use QSslSocket, I see this fails in console log:

        qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
        qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
        qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get_peer_certificate
        SSL error: "The peer did not present any certificate"
        Socket error: QAbstractSocket::SocketError(13)
        

        How I can fix this with minimal pain?

        Thanks.

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 3 Apr 2023, 18:43 last edited by
        #2

        Hi,

        Which version of Qt are you using ?

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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          acetone
          wrote on 4 Apr 2023, 06:28 last edited by
          #3

          Qt 5.15.2 from official online installer, Ubuntu 22.04

          S 1 Reply Last reply 4 Apr 2023, 20:40
          0
          • A acetone
            4 Apr 2023, 06:28

            Qt 5.15.2 from official online installer, Ubuntu 22.04

            S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 4 Apr 2023, 20:40 last edited by
            #4

            Seeing the version of Ubuntu you are using, if you want to stay with Qt 5, then you should use the one from the distribution since it follows pretty closely the latest releases done after 5.15.2.

            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 6 Apr 2023, 15:25
            1
            • S SGaist
              4 Apr 2023, 20:40

              Seeing the version of Ubuntu you are using, if you want to stay with Qt 5, then you should use the one from the distribution since it follows pretty closely the latest releases done after 5.15.2.

              A Offline
              A Offline
              acetone
              wrote on 6 Apr 2023, 15:25 last edited by
              #5

              Qt 6.x.x displays similar errors. So, Qt version is not important in this case. Qt6 reports seems more friendly:

              qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
              qt.network.ssl: The backend "cert-only" does not support QSslKey
              qt.network.ssl: Active TLS backend does not support key creation
              qt.network.ssl: The backend "cert-only" does not support QSslSocket
              qt.network.ssl: The backend named "cert-only" does not support TLS
              qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
              

              I didn't understand your advice a bit above.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                acetone
                wrote on 6 Apr 2023, 15:37 last edited by
                #6

                Similar issue: https://forum.qt.io/topic/136538/workaround-for-using-ssl-3-in-qt-6-3

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  acetone
                  wrote on 7 Apr 2023, 06:22 last edited by
                  #7

                  Solved by manual linking with openssl1 and ssl1.

                  1. Download old openssl sources:
                  wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
                  
                  1. Compile:
                  tar -xf openssl-1.1.1q.tar.gz
                  cd openssl-1.1.1q
                  ./config
                  make
                  
                  1. Add to project:
                  # .pro file:
                  LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
                  
                  D 1 Reply Last reply 30 May 2023, 07:45
                  1
                  • A acetone has marked this topic as solved on 7 Apr 2023, 06:23
                  • A acetone
                    7 Apr 2023, 06:22

                    Solved by manual linking with openssl1 and ssl1.

                    1. Download old openssl sources:
                    wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
                    
                    1. Compile:
                    tar -xf openssl-1.1.1q.tar.gz
                    cd openssl-1.1.1q
                    ./config
                    make
                    
                    1. Add to project:
                    # .pro file:
                    LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
                    
                    D Offline
                    D Offline
                    dfpr
                    wrote on 30 May 2023, 07:45 last edited by
                    #8

                    @acetone said in QSslSocket failure from Online Installer version (Ubuntu):

                    Solved by manual linking with openssl1 and ssl1.

                    1. Download old openssl sources:
                    wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz
                    
                    1. Compile:
                    tar -xf openssl-1.1.1q.tar.gz
                    cd openssl-1.1.1q
                    ./config
                    make
                    
                    1. Add to project:
                    # .pro file:
                    LIBS += -L/path/to/openssl-1.1.1q -lcrypto -L/path/to/openssl-1.1.1q -lssl
                    

                    This fixed the issue for me on Ubuntu 22.04 / Qt 5.15 but only when starting my program from Qt Creator, running it from the console shows the same ssl error...

                    1 Reply Last reply
                    0
                    • D Damian7546 referenced this topic on 25 Nov 2024, 10:37

                    1/8

                    3 Apr 2023, 17:55

                    • Login

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