[Interest] HTTPS with Qt

Konstantin Tokarev annulen at yandex.ru
Thu Oct 6 16:06:01 CEST 2016



06.10.2016, 16:52, "Larry Martell" <larry.martell at gmail.com>:
> I have a Qt app that sends requests to a server like this:
>
>   QString urlStr = "http://foo.bar.com/baz";
>   QUrl transferUrl(urlStr);
>   QNetworkRequest request(transferUrl);
>   networkReply = networkManager.get(request);
>
> We need to change this to use HTTPS. We have the needed certs on the
> server. Can someone please point me at some docs that will help me get
> the Qt app modified to work with HTTPS. From what I've been able to
> find I need to install a root certificate, but I don't know what that
> means or how to do it. Also, what changes do I have to make in the Qt
> code? Is it simply changing http to https? From a browser that is all
> I had to do, presumedly because the browser already had the root
> certificate. Any pointers will be greatly appreciated.

* If your server is using certificate which is does not have well-known root
CA it the validation chain, you have to add CA certificate manually to prevent
SSL errors.

* If your server checks client certificates, you have to add client certificate
in PEM or DER format and it's private key.

Otherwise, no action is needed.

>
> Thanks!
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Regards,
Konstantin



More information about the Interest mailing list