168bool QSslConfiguration::operator==(
const QSslConfiguration &other)
const
172 return d->peerCertificate == other.d->peerCertificate &&
173 d->peerCertificateChain == other.d->peerCertificateChain &&
174 d->localCertificateChain == other.d->localCertificateChain &&
175 d->privateKey == other.d->privateKey &&
176 d->sessionCipher == other.d->sessionCipher &&
177 d->sessionProtocol == other.d->sessionProtocol &&
178 d->preSharedKeyIdentityHint == other.d->preSharedKeyIdentityHint &&
179 d->ciphers == other.d->ciphers &&
180 d->ellipticCurves == other.d->ellipticCurves &&
181 d->ephemeralServerKey == other.d->ephemeralServerKey &&
182 d->dhParams == other.d->dhParams &&
183 d->caCertificates == other.d->caCertificates &&
184 d->protocol == other.d->protocol &&
185 d->peerVerifyMode == other.d->peerVerifyMode &&
186 d->peerVerifyDepth == other.d->peerVerifyDepth &&
187 d->allowRootCertOnDemandLoading == other.d->allowRootCertOnDemandLoading &&
188 d->backendConfig == other.d->backendConfig &&
189 d->sslOptions == other.d->sslOptions &&
190 d->sslSession == other.d->sslSession &&
191 d->sslSessionTicketLifeTimeHint == other.d->sslSessionTicketLifeTimeHint &&
192 d->nextAllowedProtocols == other.d->nextAllowedProtocols &&
193 d->nextNegotiatedProtocol == other.d->nextNegotiatedProtocol &&
194 d->nextProtocolNegotiationStatus == other.d->nextProtocolNegotiationStatus &&
195 d->keyingMaterial == other.d->keyingMaterial &&
196 d->dtlsCookieEnabled == other.d->dtlsCookieEnabled &&
197 d->ocspStaplingEnabled == other.d->ocspStaplingEnabled &&
198 d->reportFromCallback == other.d->reportFromCallback &&
199 d->missingCertIsFatal == other.d->missingCertIsFatal;
221bool QSslConfiguration::isNull()
const
223 return (d->protocol == QSsl::SecureProtocols &&
224 d->peerVerifyMode == QSslSocket::AutoVerifyPeer &&
225 d->peerVerifyDepth == 0 &&
226 d->allowRootCertOnDemandLoading ==
true &&
227 d->caCertificates.size() == 0 &&
228 d->ciphers.size() == 0 &&
229 d->ellipticCurves.isEmpty() &&
230 d->ephemeralServerKey.isNull() &&
231 d->dhParams == QSslDiffieHellmanParameters::defaultParameters() &&
232 d->localCertificateChain.isEmpty() &&
233 d->privateKey.isNull() &&
234 d->peerCertificate.isNull() &&
235 d->peerCertificateChain.size() == 0 &&
236 d->backendConfig.isEmpty() &&
237 d->sslOptions == QSslConfigurationPrivate::defaultSslOptions &&
238 d->sslSession.isNull() &&
239 d->sslSessionTicketLifeTimeHint == -1 &&
240 d->preSharedKeyIdentityHint.isNull() &&
241 d->nextAllowedProtocols.isEmpty() &&
242 d->nextNegotiatedProtocol.isNull() &&
243 d->nextProtocolNegotiationStatus == QSslConfiguration::NextProtocolNegotiationNone &&
244 d->keyingMaterial.isEmpty() &&
245 d->ocspStaplingEnabled ==
false &&
246 d->reportFromCallback ==
false &&
247 d->missingCertIsFatal ==
false);
598void QSslConfiguration::setCiphers(
const QString &ciphers)
602 const auto cipherNames = ciphers.split(u':', Qt::SkipEmptyParts);
603 for (
const QString &cipherName : cipherNames) {
604 QSslCipher cipher(cipherName);
605 if (!cipher.isNull())
606 p->ciphers << cipher;
673bool QSslConfiguration::addCaCertificates(
const QString &path, QSsl::EncodingFormat format,
674 QSslCertificate::PatternSyntax syntax)
676 QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax);
680 d->caCertificates += certs;
1297QSslConfiguration::keyingMaterial(
const QSslKeyingMaterial &material)
const
1299 for (
const auto &entry : std::as_const(d->keyingMaterial)) {
1300 if (entry.label() == material.label() &&
1301 entry.context() == material.context() &&
1302 entry.size() == material.size()) {
1307 return std::nullopt;