Pop3S with SSL

  • hello,
    i start to wright my own pop3s client but i have problems to connect to the server.
    has anybody any experience with with topic or maybe a manual???? ;-)
    thanx a lot

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Since it's a Qt forum, how is it related to Qt ?

  • sorry. ;-) i wanna do it with QSslSocket and C++:

    QSslSocket socket
    socket.connectToHostEncrypted(, 995)

    if (!socket.waitForEncrypted(30000))
    qDebug("Not Encrypted!");


    and i always got "Not Encrypted!".
    But with a normal openssl connection (openssl s_client -connect on the bash its no problem to login to the server. i am beginner and don't which further steps are necessary for such an QSslSocket connection.


  • If I'm right: first connection to pop3 server is not encrypted! You then should get answer from server where should be some words about possible communication protocols: SSl, TLS etc, you should tel the server which you would like to use and after that you should do handshake and so on.... But it is already long time ago I have played with this protocols...

  • i am still fighting with the POP3 SSL problem, but now i have some little progress and some more infos:

    i can connect to the pop3 server with:
    socket.connectToHostEncrypted(, 995)

    than i have following state:
    -This system supports OpenSSL.
    -ClientStateChanged(): ConnectedState
    -ClientModeChanged(): SslClientMode

    than i have 2 errors:

    • ssl error: The host name did not match any of the valid hosts for this certificate
    • ssl error: The root certificate of the certificate chain is self-signed, and untrusted

    but when i ignore these errors: socket.ignoreSslErrors(); than i got the encrypted() signal.
    (is this ignoring ok, or should i create a own certificate????)

    when i am waitting for more data from the socket socket.waitForReadyRead(15000) than this function timed out. in the normal way i get this "OK+" from the pop3 server, but here i dont get an answer from the server...

    any ideas whats wrong?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.