[Interest] How to trust certificates for QWebPage
Tom.Isaacson at navico.com
Mon May 26 20:42:31 CEST 2014
I don't understand that first sentence. What do you mean by "your server"? If I'm trying to use https on, for example, Twitter, how do I create a certificate for it?
From: interest-bounces+tom.isaacson=navico.com at qt-project.org [mailto:interest-bounces+tom.isaacson=navico.com at qt-project.org] On Behalf Of Richard Moore
Sent: Tuesday, 27 May 2014 1:11 a.m.
To: interest at qt-project.org
Subject: Re: [Interest] How to trust certificates for QWebPage
What you need to do is create your own CA certificate, then generate a leaf certificate that is signed by it for your server. You then get the QNetworkAccessManager that you're using to load the content for your QWebPage and get its QSslConfiguration. Finally use setCaCertificate on the configuration to tell it to trust certificates signed by your custom CA.
On 26 May 2014 11:30, Tom Isaacson <Tom.Isaacson at navico.com> wrote:
We're implementing an application on an embedded Linux device that includes a browser using QWebPage in Qt 4.8.2. We also have OpenSSL installed but when I try to use https it fails with the error "SSL handshake failed". I can avoid this by calling ignoreSslErrors() in QWebPage::sslErrorHandler() but this isn't a solution.
The way I think this should work is that when the device receives the certificate it should check it with the certificate authority. Is there some code I need to add to do this? Alternatively, because this is a custom embedded Linux device I'm wondering if I need to add some kind of certificate, since it doesn't have anything right now. I can see from the code at the bottom of this article that it's possible to add certificates but I don't know what kind of certificate or where to get it from:
Any suggestions would be a great help, thanks.
Interest mailing list
Interest at qt-project.org
More information about the Interest