mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Support SSL certificate bundles. Issue #4896.
This commit is contained in:
parent
15ec515872
commit
f50a8d4f59
3 changed files with 15 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue