0001-Support-intermediate-CA-certificates.patch
| src/core/sslserver.cpp | ||
|---|---|---|
| 60 | 60 |
if(isCertValid()) {
|
| 61 | 61 |
serverSocket->setLocalCertificate(_cert); |
| 62 | 62 |
serverSocket->setPrivateKey(_key); |
| 63 |
serverSocket->addCaCertificates(_ca); |
|
| 63 | 64 |
} |
| 64 | 65 |
_pendingConnections << serverSocket; |
| 65 | 66 |
emit newConnection(); |
| ... | ... | |
| 86 | 87 |
<< "error:" << certFile.error(); |
| 87 | 88 |
return false; |
| 88 | 89 |
} |
| 89 |
_cert = QSslCertificate(&certFile); |
|
| 90 | ||
| 91 |
QList<QSslCertificate> certList = QSslCertificate::fromDevice(&certFile); |
|
| 92 | ||
| 93 |
if (certList.isEmpty()) {
|
|
| 94 |
quWarning() << "SslServer: Certificate file doesn't contain a certificate"; |
|
| 95 |
return false; |
|
| 96 |
} |
|
| 97 | ||
| 98 |
_cert = certList[0]; |
|
| 99 |
certList.removeFirst(); // remove server cert |
|
| 100 | ||
| 101 |
// store CA and intermediates certs |
|
| 102 |
_ca = certList; |
|
| 90 | 103 | |
| 91 | 104 |
if(!certFile.reset()) {
|
| 92 | 105 |
quWarning() << "SslServer: IO error reading certificate file"; |
| src/core/sslserver.h | ||
|---|---|---|
| 49 | 49 |
QLinkedList<QTcpSocket *> _pendingConnections; |
| 50 | 50 |
QSslCertificate _cert; |
| 51 | 51 |
QSslKey _key; |
| 52 |
QList<QSslCertificate> _ca; |
|
| 52 | 53 |
bool _isCertValid; |
| 53 | 54 |
}; |
| 54 | 55 | |
| 55 |
- |
|