added error from mac to trusted errors as possible workaround; refs #43

This commit is contained in:
Marc Wäckerlin
2011-05-11 13:17:53 +00:00
parent 382f7e7791
commit bf58795682
7 changed files with 20 additions and 12 deletions

View File

@@ -119,10 +119,18 @@ class SmartCardAuth: public QObject {
void extendedContextInitialization(ssl_ctx_st* ctx, QSslSocket* socket) {
qDebug()<<__PRETTY_FUNCTION__;
for (std::list<std::string>::iterator cert(_cacerts.begin()); cert!=_cacerts.end(); ++cert) {
QList<QSslError> expectedSslErrors;
for (std::list<std::string>::iterator cert(_cacerts.begin());
cert!=_cacerts.end(); ++cert) {
SSL_CTX_add_extra_chain_cert(ctx, openssl::X509(*cert).lowLevelCopy());
qDebug()<<"Added:\n"<<QSslCertificate(QByteArray(cert->data(), cert->size()), QSsl::Der).toPem();
expectedSslErrors.push_back(QSslError(QSslError::SelfSignedCertificate,
QSslCertificate::fromData
(QByteArray(cert->data(),
cert->size()),
QSsl::Der).at(0)));
//qDebug()<<"Added:\n"<<QSslCertificate(QByteArray(cert->data(), cert->size()), QSsl::Der).toPem();
}
socket->ignoreSslErrors(expectedSslErrors);
SSL_CTX_set_client_cert_cb(ctx, &SmartCardAuth::clientCert);
}