167bool QSslConfiguration::operator==(
const QSslConfiguration &other)
const
171 return d->peerCertificate == other.d->peerCertificate &&
172 d->peerCertificateChain == other.d->peerCertificateChain &&
173 d->localCertificateChain == other.d->localCertificateChain &&
174 d->privateKey == other.d->privateKey &&
175 d->sessionCipher == other.d->sessionCipher &&
176 d->sessionProtocol == other.d->sessionProtocol &&
177 d->preSharedKeyIdentityHint == other.d->preSharedKeyIdentityHint &&
178 d->ciphers == other.d->ciphers &&
179 d->ellipticCurves == other.d->ellipticCurves &&
180 d->ephemeralServerKey == other.d->ephemeralServerKey &&
181 d->dhParams == other.d->dhParams &&
182 d->caCertificates == other.d->caCertificates &&
183 d->protocol == other.d->protocol &&
184 d->peerVerifyMode == other.d->peerVerifyMode &&
185 d->peerVerifyDepth == other.d->peerVerifyDepth &&
186 d->allowRootCertOnDemandLoading == other.d->allowRootCertOnDemandLoading &&
187 d->backendConfig == other.d->backendConfig &&
188 d->sslOptions == other.d->sslOptions &&
189 d->sslSession == other.d->sslSession &&
190 d->sslSessionTicketLifeTimeHint == other.d->sslSessionTicketLifeTimeHint &&
191 d->nextAllowedProtocols == other.d->nextAllowedProtocols &&
192 d->nextNegotiatedProtocol == other.d->nextNegotiatedProtocol &&
193 d->nextProtocolNegotiationStatus == other.d->nextProtocolNegotiationStatus &&
194 d->dtlsCookieEnabled == other.d->dtlsCookieEnabled &&
195 d->ocspStaplingEnabled == other.d->ocspStaplingEnabled &&
196 d->reportFromCallback == other.d->reportFromCallback &&
197 d->missingCertIsFatal == other.d->missingCertIsFatal;
219bool QSslConfiguration::isNull()
const
221 return (d->protocol == QSsl::SecureProtocols &&
222 d->peerVerifyMode == QSslSocket::AutoVerifyPeer &&
223 d->peerVerifyDepth == 0 &&
224 d->allowRootCertOnDemandLoading ==
true &&
225 d->caCertificates.size() == 0 &&
226 d->ciphers.size() == 0 &&
227 d->ellipticCurves.isEmpty() &&
228 d->ephemeralServerKey.isNull() &&
229 d->dhParams == QSslDiffieHellmanParameters::defaultParameters() &&
230 d->localCertificateChain.isEmpty() &&
231 d->privateKey.isNull() &&
232 d->peerCertificate.isNull() &&
233 d->peerCertificateChain.size() == 0 &&
234 d->backendConfig.isEmpty() &&
235 d->sslOptions == QSslConfigurationPrivate::defaultSslOptions &&
236 d->sslSession.isNull() &&
237 d->sslSessionTicketLifeTimeHint == -1 &&
238 d->preSharedKeyIdentityHint.isNull() &&
239 d->nextAllowedProtocols.isEmpty() &&
240 d->nextNegotiatedProtocol.isNull() &&
241 d->nextProtocolNegotiationStatus == QSslConfiguration::NextProtocolNegotiationNone &&
242 d->ocspStaplingEnabled ==
false &&
243 d->reportFromCallback ==
false &&
244 d->missingCertIsFatal ==
false);
595void QSslConfiguration::setCiphers(
const QString &ciphers)
599 const auto cipherNames = ciphers.split(u':', Qt::SkipEmptyParts);
600 for (
const QString &cipherName : cipherNames) {
601 QSslCipher cipher(cipherName);
602 if (!cipher.isNull())
603 p->ciphers << cipher;
670bool QSslConfiguration::addCaCertificates(
const QString &path, QSsl::EncodingFormat format,
671 QSslCertificate::PatternSyntax syntax)
673 QList<QSslCertificate> certs = QSslCertificate::fromPath(path, format, syntax);
677 d->caCertificates += certs;