mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Add HTTPS tracker certificate validation option
This commit adds a new libtorrent setting to validate HTTPS tracker certificates. When enabled, libtorrent will validate the certificate of HTTPS trackers against the system's certificate store. This option is only enabled on libtorrent versions >= 1.2.6 and on non-Windows systems, as OpenSSL does not use the system's certificate store on Windows.
This commit is contained in:
@@ -105,6 +105,9 @@ enum AdvSettingsRows
|
||||
OUTGOING_PORT_MAX,
|
||||
UTP_MIX_MODE,
|
||||
MULTI_CONNECTIONS_PER_IP,
|
||||
#ifdef HAS_HTTPS_TRACKER_VALIDATION
|
||||
VALIDATE_HTTPS_TRACKER_CERTIFICATE,
|
||||
#endif
|
||||
// embedded tracker
|
||||
TRACKER_STATUS,
|
||||
TRACKER_PORT,
|
||||
@@ -209,6 +212,10 @@ void AdvancedSettings::saveAdvancedSettings()
|
||||
session->setUtpMixedMode(static_cast<BitTorrent::MixedModeAlgorithm>(m_comboBoxUtpMixedMode.currentIndex()));
|
||||
// multiple connections per IP
|
||||
session->setMultiConnectionsPerIpEnabled(m_checkBoxMultiConnectionsPerIp.isChecked());
|
||||
#ifdef HAS_HTTPS_TRACKER_VALIDATION
|
||||
// Validate HTTPS tracker certificate
|
||||
session->setValidateHTTPSTrackerCertificate(m_checkBoxValidateHTTPSTrackerCertificate.isChecked());
|
||||
#endif
|
||||
// Recheck torrents on completion
|
||||
pref->recheckTorrentsOnCompletion(m_checkBoxRecheckCompleted.isChecked());
|
||||
// Transfer list refresh interval
|
||||
@@ -485,6 +492,13 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
// multiple connections per IP
|
||||
m_checkBoxMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
||||
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &m_checkBoxMultiConnectionsPerIp);
|
||||
#ifdef HAS_HTTPS_TRACKER_VALIDATION
|
||||
// Validate HTTPS tracker certificate
|
||||
m_checkBoxValidateHTTPSTrackerCertificate.setChecked(session->validateHTTPSTrackerCertificate());
|
||||
addRow(VALIDATE_HTTPS_TRACKER_CERTIFICATE, (tr("Validate HTTPS tracker certificates")
|
||||
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#validate_https_trackers", "(?)"))
|
||||
, &m_checkBoxValidateHTTPSTrackerCertificate);
|
||||
#endif
|
||||
// Recheck completed torrents
|
||||
m_checkBoxRecheckCompleted.setChecked(pref->recheckTorrentsOnCompletion());
|
||||
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &m_checkBoxRecheckCompleted);
|
||||
|
||||
Reference in New Issue
Block a user