Results 1 to 4 of 4

Thread: ssl verification fails but the request continue !!!!

  1. #1
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation ssl verification fails but the request continue !!!!

    Hi guys,

    I am trying to use an api and i have been asked to be sure first that i am using our backend using ssl verification.

    so I used the following code
    Qt Code:
    1. QFile certFile("d:/backend.cer");
    2. Q_ASSERT(certFile.open(QIODevice::ReadOnly));
    3. qDebug()<< "is ssl supported? " << QSslSocket::supportsSsl();
    4. QByteArray certContent = certFile.readAll();
    5.  
    6. QSslCertificate cert(certContent, QSsl::Der);
    7.  
    8. kdebug() <<"Cert info: " << cert.effectiveDate() << cert.expiryDate() << cert.issuerInfo(QSslCertificate::Organization);
    9.  
    10. QSslConfiguration sslConfig = request.sslConfiguration();
    11.  
    12. sslConfig.setCaCertificates(QList<QSslCertificate>()<< cert);
    13. sslConfig.setPeerVerifyMode(QSslSocket::QueryPeer);
    14. request.setSslConfiguration(sslConfig);
    To copy to clipboard, switch view to plain text mode 

    I have two problems here
    1- The certificate is not verified and i always get the following response
    "ssl error = "The issuer certificate of a locally looked up certificate could not be found"
    ssl error = "The root CA certificate is not trusted for this purpose""

    2- However the ssl fails to verify the certificate it continues the request and receive the data!!!!

    Could any body please help?

    Regards,
    M.Ismail

  2. #2
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ssl verification fails but the request continue !!!!

    Is there any body here?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ssl verification fails but the request continue !!!!

    Please prepare a minimal compilable example reproducing the problem. In particular tell us whether you do anything with the ignoreSslErrors() call.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:

    mismael85 (17th August 2014)

  5. #4
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ssl verification fails but the request continue !!!!

    I fixed it. I should not igonre ssl errors

Similar Threads

  1. Continue developing Qt in RIM!
    By vladi in forum Jobs
    Replies: 1
    Last Post: 6th August 2012, 12:42
  2. 'Continue' in games help!
    By bmn in forum Newbie
    Replies: 3
    Last Post: 17th August 2011, 22:55
  3. why debug console continue appear?
    By banlinhtienphong in forum Qt Programming
    Replies: 4
    Last Post: 27th April 2011, 13:03
  4. Replies: 13
    Last Post: 26th January 2011, 16:11
  5. How to wait 2 seconds before continue
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 25th June 2008, 14:36

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.