View Full Version : QSslSocket::sslErrors() is emitted even after ignoring errors?

6th November 2013, 17:06
Dear all,

I'm a bit confused about the supposed workings of the sslErrors() signal. My understanding was, that this signal is only called when there are SSL errors and if you set exactly those errors in ignoreSslErrors(), then the signal isn't emitted anymore (since those are now valid SSL errors and should be ignored; and if I remember correctly, that's exactly how it worked in Qt 4.x a few years ago).

But the signal is always emitted, even if I ignore all errors!

When I connect for the first time, I correctly get SSL errors (self signed etc.) and QSslSocket drops the connection. If I then take those errors (after the user gave his ok etc etc) and pass themto ignoreSslErrors(), the signal is still emitted but QSslSocket establishes the connection. So it seems that the passed in errors are correct.

Is my understanding of sslErrors() wrong and if so, do I really need to manually compare the errors reported by sslErrors() with the ones the user wants ignored (so I can present a dialog nwhatnot)?

As always, thanks a lot in advance and best regards...

Environment: Windows 7 64bit, Qt 5.1.1, MinGW 4.8.0

6th November 2013, 21:17
Ok... digging through the source, sslErrors() seems to always be emitted, regardless of what is set via ignoreSslErrors(). But QSslSocket::error( QAbstractSocket::SslHandshakeFailedError ) will not be emitted anymore, so one has to use a combination of those two I guess...