-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): add option to ignore SSL errors #1521
feat(core): add option to ignore SSL errors #1521
Conversation
https://forum.qt.io/topic/125873/how-to-clear-qnetworkreply-ignoresslerrors Otherwise, if you try to disable the ignoring of SSL errors, the new ignore settings will not take immediate effect due to the keep-alive connection with the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! Even ignoring the certificate expiration problem from the last week, I think this is a good workaround for all the SSL related issues reported over the years.
I have a few minor suggestions, please see inline.
src/libs/ui/settingsdialog.cpp
Outdated
if (settings->isIgnoreSSLErrorsEnabled != ui->ignoreSSLErrorsCheckBox->isChecked()) { | ||
// https://forum.qt.io/topic/125873/how-to-clear-qnetworkreply-ignoresslerrors/2 | ||
m_application->networkManager()->clearAccessCache(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already done in Core::Application::applySettings
, but needs to be moved outside of proxy selection switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - c3be7f4 .
src/libs/ui/docsetsdialog.cpp
Outdated
if (m_application->settings()->isIgnoreSSLErrorsEnabled) { | ||
// Connect to the reply's sslErrors signal to handle SSL errors | ||
connect(reply, &QNetworkReply::sslErrors, [=](const QList<QSslError>& errors){ | ||
// Ignore all SSL errors | ||
reply->ignoreSslErrors(); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This signal should be handled on Core::NetworkAccessManager
to cover all network activity performed by Zeal.
The easiest approach would probably be handling the signal in Core::Application
, when network manager is created. Not the most elegant solution, but would avoid the need to pass settings into Core::NetworkAccessManager
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You meant like this - b4e2c86 ? If so - done.
Co-authored-by: Oleg Shparber <trollixx@gmail.com>
Co-authored-by: Oleg Shparber <trollixx@gmail.com>
This reverts commit c851ede.
to correct handle of isIgnoreSSLErrorsEnabled, details: https://forum.qt.io/topic/125873/how-to-clear-qnetworkreply-ignoresslerrors/2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround.
Not at all, happy to assist! Thank you for providing those suggestions and explanations. |
This pull request adds network settings to ignore SSL errors in order to handle the cases described here:
When the SSL certificate on the server is expired or invalid, users can still download from that server by choosing to ignore SSL errors.
If the project maintainers find this feature unacceptable, I apologize.