mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Support SSL certificate bundles. Issue #4896.
This commit is contained in:
committed by
Brandon Rutledge
parent
15ec515872
commit
f50a8d4f59
@@ -65,11 +65,12 @@ void WebUI::init()
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
if (pref->isWebUiHttpsEnabled()) {
|
||||
QSslCertificate cert(pref->getWebUiHttpsCertificate());
|
||||
QList<QSslCertificate> certs = QSslCertificate::fromData(pref->getWebUiHttpsCertificate());
|
||||
QSslKey key;
|
||||
key = QSslKey(pref->getWebUiHttpsKey(), QSsl::Rsa);
|
||||
if (!cert.isNull() && !key.isNull())
|
||||
httpServer_->enableHttps(cert, key);
|
||||
bool certsIsNull = std::any_of(certs.begin(), certs.end(), [](QSslCertificate c) { return c.isNull(); });
|
||||
if (!certsIsNull && !certs.empty() && !key.isNull())
|
||||
httpServer_->enableHttps(certs, key);
|
||||
else
|
||||
httpServer_->disableHttps();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user