Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    smtp osx ssl mac
    2
    3
    2080
    Loading More Posts
    • 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.
    • R
      Rida last edited by Rida

      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.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        This bug report might interest you

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

        R 1 Reply Last reply Reply Quote 0
        • R
          Rida @SGaist last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post