I am sending requests through QNetworkAccessManager::createRequest(Operation, QNetworkRequest, outgoingData). I must confirm that the fingerprint of the SSL certificate is the one that I expect. Unfortunately, the resulting one QNetworkReplyreturns a peerCertificatewith an empty signature.
The documentation states the following:
Since the peer certificate is installed at the stage of establishing the connection, it is safe to access the peer certificate from the slot connected to the sslErrors () signal or the encrypted () signal.
If a null certificate is returned, this may mean that the SSL handshake has not been completed, or it may mean that the host you are connected to does not have a certificate, or it may mean that the connection is down.
Therefore, the error may be that the connection is already closed. I cannot use the signal QNetworkAccessManager::sslErrors(), as this signal will not be emitted when using SSL proxy (this is what I want to prevent).
How to get an SSL server certificate? Could there be more signals that I have access to and where the certificate is still available? Is there any other way to get a certificate?
Update:
Now I can get the correct certificate by responding to QNetworkAccessManager::finished(QNetworkReply*)Signal. But , unfortunately, this signal is not issued when sending an AJAX-Request. It is imperative for me to also verify the fingerprint of these Requests. Any ideas?
Senad source
share