Sending mail via smtp.gmail.com in QT on OSX



  • Hi,

    I'm trying to do something that should be quite straightforward.
    My application should send an e-mail to a list of addresses. Since it will be a simple message containing some text I thought smtp would be enough to get the job done, and google provides an smtp server (smtp.gmail.com)

    I based my code on an example I found online which was very helpful.
    http://morf.lv/modules.php?name=tutorials&lasit=20

    When I tested my code everything seemed to go well until I got to the point where the connection was supposed to be made my debug output shows this:

    qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
    qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    stateChanged  QAbstractSocket::HostLookupState
    stateChanged  QAbstractSocket::ConnectingState
    stateChanged  QAbstractSocket::ConnectedState
    Connected 
    error  QAbstractSocket::SocketError(13)
    stateChanged  QAbstractSocket::ClosingState
    stateChanged  QAbstractSocket::UnconnectedState
    disconneted
    error  "The issuer certificate of a locally looked up certificate could not be found"
    

    I thought maybe the fault was in my code so I tested the example provided online and got the same issue.
    I googled for a while and found out that OSX has some issues with OpenSSL, and that's why the connection can't be made.
    I have absolutely no experience with SSL or anything like it so I was wondering if anyone could tell me how to work around this issue on mac.
    Any help would be much appreciated.


  • Lifetime Qt Champion

    Hi,

    This bug report might interest you



  • @SGaist

    Thank you very much, I used the work-around they proposed
    (storing a copy of the certificate in the local resources of the app & adding that to the default CACertificate list before opening the socket)
    I'm afraid this won't be a clean long term solution though (the certificate will stay valid for a while, but eventually expires I guess).
    If anyone has any idea's for a more clean/permanent solution I'm very much open to suggestions.
    In the mean time this will have to do.
    Thanks again, I appreciate the comment


Log in to reply
 

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