void SSLConnect::setToken( const QSslCertificate &cert, Qt::HANDLE key ) { if( !d->ssl ) return d->setError( tr("SSL context is missing") ); if( cert.isNull() ) return d->setError( tr("Certificate is empty") ); if( !SSL_use_certificate( d->ssl, X509_dup( (X509*)cert.handle() ) ) || !SSL_use_PrivateKey( d->ssl, (EVP_PKEY*)key ) ) d->setError(); }
foreach (const QSslCertificate &certificate, remove) { QHash<QSslCertificate, QAtomicInt>::iterator it = additionalCertificates.find(certificate); if (it != additionalCertificates.end() && !it.value().deref()) { // no more references, remove certificate HRESULT hr; hr = rootStore->Delete(static_cast<ICertificate *>(certificate.handle())); Q_ASSERT_SUCCEEDED(hr); additionalCertificates.erase(it); } }