Results 1 to 10 of 10

Thread: QNetworkAccessManager: "SSL handshake failed"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager: "SSL handshake failed"

    I too have had problems getting client certificates to work with Qt4.5.x, both with clients coded with Qt itself, and with libcurl.

    I raised a bug in Tasktracker sometime ago (258725) but for some reason, it doesn't seem to show up when I do a search (do Nokia hide some of them, for some reason ?)

    If anyone is sufficiently interested, I can send them a tarball of the code and bug report that I submitted to Tasktracker.

  2. #2
    Join Date
    Oct 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QNetworkAccessManager: "SSL handshake failed"

    Hey!

    How did you do this? Would love to see some code!
    And did you solve it anyway?

    When to set the QSslConfiguration?
    How to get my Ssl cfg into the QtSoapHttpTransport class?

  3. #3
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager: "SSL handshake failed"

    >How did you do this?

    I assume that you mean me ? If so, how did I do what ? How did I submit a bug report to Nokia ?

    >Would love to see some code!

    You want to see the code for the submitted bug report ?

    >And did you solve it anyway?

    No. It's still an outstanding problem. AFAICS there's a bug in Qt's SSL logic, and I'm hoping that they'll look at it someday. I've had no response to the bug report so far.

  4. #4
    Join Date
    Oct 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QNetworkAccessManager: "SSL handshake failed"

    No,I mean how you found out that there is a bug!
    The strange thing is: I connect to gammel.de using setHost("gammel.de", true);
    and there I try to get the method "j_security_check" n the same subfolder.,
    As soon as I do thos I receive the sslError Signal. Telling me that I do not have ca cert and so on!

    But when I do this local this doesnt work! I just receive readyRead and the message is Fault!

    May I see your code?

    What do you think the the error comes from?
    ow/where when do you submit your Sslconfiguraion?

    Qt Code:
    1. QSslConfiguration sslConfiguration = request->sslConfiguration();
    2. sslConfiguration.setLocalCertificate(cert);
    3. file.close();
    4. QString passphrase = "antivir_default";
    5. file.open(QIODevice::ReadOnly);
    6.  
    7. QSslKey key(&file, QSsl::Rsa, QSsl::Pem,QSsl::PrivateKey , passphrase.toAscii());
    8.  
    9. sslConfiguration.setCaCertificates(QList<QSslCertificate>() << cert);
    10. sslConfiguration.setPrivateKey(key);
    11. sslConfiguration.setProtocol(QSsl::TlsV1);
    12. sslConfiguration.setPeerVerifyMode(QSslSocket::QueryPeer);
    To copy to clipboard, switch view to plain text mode 


    Where request is QNetworkReply *request = http.networkReply(); // this fails....ok its a NULL ptr. when is it initialied? Or better what to use to set the cert?
    and http is QtSoapHttpTransport http;

    So I thought with request->setSslConfiguration(sslConfiguration);
    this would be used for next request but doesnt!

  5. #5
    Join Date
    Oct 2009
    Posts
    37
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QNetworkAccessManager: "SSL handshake failed"

    Hi,

    Does it work when you do setProtocol(QSsl::AnyProtocol) ?
    Disclaimer: Although I work on Qt for Nokia, anything I post here is personal

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.