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)
Forum Updated to NodeBB v4.3 + New Features

QSslSocket failure from Online Installer version (Ubuntu)

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 3.8k Views 1 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
    acetone
    wrote on 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.

    SGaistS 1 Reply Last reply
    0
    • A Offline
      A Offline
      acetone
      wrote on 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
      1
      • A acetone

        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.

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on 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 last edited by
          #3

          Qt 5.15.2 from official online installer, Ubuntu 22.04

          SGaistS 1 Reply Last reply
          0
          • A acetone

            Qt 5.15.2 from official online installer, Ubuntu 22.04

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on 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
            1
            • SGaistS SGaist

              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 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 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 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
                  1
                  • A acetone has marked this topic as solved on
                  • A acetone

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

                    • Login

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