Results 1 to 2 of 2

Thread: Porting to iOS SSL certificate problem

  1. #1
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Porting to iOS SSL certificate problem

    Hello,

    I am currently porting an application to iOS which contains a SSL-Socket including cert- and keyfile.
    The application runs fine on desktop machines cross multiple platforms, but on the iOS i get the
    following SSL-Error: "The root CA certificate is not trusted for this purpose". I could just ignore
    it (tried and worked as expected), but that does not seem to be the clear solution I am looking for.
    The certificates are self signed, but when running the application on Windows, Linux and OS X Yosemite
    it runs just fine.

    Any ideas why this is only occuring on iOs and how I can solve the issue?


    This is the part where i configure the SSL-socket:

    Qt Code:
    1. void SslClient::configureSsl()
    2. {
    3. /* Read and set certfile */
    4. QFile certFile(":/ssl/ssl/client.pem", this);
    5. if (!certFile.open(QIODevice::ReadOnly)) {
    6. qDebug() << "Error opening cert-File";
    7. }
    8. QSslCertificate sslCertificate(&certFile, QSsl::Pem);
    9. if (sslCertificate.isNull()) {
    10. qDebug() << "Certificate is empty";
    11. }
    12.  
    13. /* Read and set keyfile */
    14. QFile keyFile(":/ssl/ssl/client.key", this);
    15. if (!keyFile.open(QIODevice::ReadOnly)) {
    16. qDebug() << "Error opening key-File";
    17. }
    18. QSslKey sslKey(&keyFile, QSsl::Rsa, QSsl::Pem);
    19. if (sslKey.isNull()) {
    20. qDebug() << "Keyfile is empty";
    21. }
    22.  
    23. /* Set the configuration */
    24. sslConfig.setLocalCertificate(sslCertificate);
    25. sslConfig.setPrivateKey(sslKey);
    26. sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
    27. sslConfig.setProtocol(QSsl::TlsV1SslV3);
    28. setSslConfiguration(sslConfig);
    29. }
    To copy to clipboard, switch view to plain text mode 


    thank you in advance.

  2. #2
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: Porting to iOS SSL certificate problem

    nobody got an idea?

Similar Threads

  1. Replies: 1
    Last Post: 29th October 2012, 08:25
  2. Replies: 3
    Last Post: 17th October 2012, 10:30
  3. Ui problem of QT3 porting to QT4
    By batileon in forum Newbie
    Replies: 1
    Last Post: 12th June 2008, 11:31
  4. QT3 porting to QT4 problem
    By batileon in forum Newbie
    Replies: 3
    Last Post: 8th June 2008, 00:58
  5. Porting problem from Qt3 to Qt4
    By Krishnacins in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2006, 15:29

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.