Kann man mit QHttp auch eine Client authentifizierung durch ein Client Zertifikat durchzuführen?
So das es erfolgreich mit Apache Konfiguration (httpd-ssl.conf) arbeitet:
Code: Alles auswählen
SSLVerifyClient require
SSLVerifyDepth 2
Gruss
qtagent
Code: Alles auswählen
SSLVerifyClient require
SSLVerifyDepth 2
Code: Alles auswählen
QSslSocket*sslSocket;
...
QHttp::setSocket(sslSocket);
...Code: Alles auswählen
sslSocket->setLocalCertificate("/home/User/client.pem",QSsl::Pem);-openssl nicht gesehen? Und dann steht da noch was in der Doku zu QSslSocket:qtagent hat geschrieben:Habe mir die Configure Optionen angeschaut, doch nichts gefunden und glaube auch nicht das dort die Lösung zu finden ist.
Also, OpenSSL downloaden, nach Qt/src/network kopieren, neues configure mit -openssl und dann noch den QtNetwork-Part neu compilieren. Dann sollte es funktionieren, obwohl ich noch auf verzweifelter Suche nach einem Bug bin.Qt Doku hat geschrieben:This product uses software developed by the OpenSSL Project for use in the OpenSSL Toolkit. You can download the necessary software from http://www.openssl.org/.
Verrätst Du auch woran es gelegen hat?qtagent hat geschrieben:Es hat nun Funktioniert
Ich hab Qt 4.4.0 mit "-openssl" compiliert, wobei ich kein OpenSSL Quellcode brauchte.macman hat geschrieben:Verrätst Du auch woran es gelegen hat?qtagent hat geschrieben:Es hat nun Funktioniert
Code: Alles auswählen
setupUi(this);
QHttp http=new QHttp(this);
QSslSocket sslSocket=new QSslSocket(this);
connect(sslSocket,SIGNAL(sslErrors(const QList<QSslError>&)),this,SLOT(sslSocketSslErrors(const QList<QSslError>&)))
http->setSocket(sslSocket);
...
Code: Alles auswählen
sslSocket->addCaCertificates("ca-bundle.crt",QSsl::Pem);
sslSocket->setLocalCertificate("client-rsa.crt",QSsl::Pem);
if(!sslSocket->localCertificate().isValid())
qFatal("Client Zertifikat ungültig.");
sslSocket->setPrivateKey("client-rsa.key",QSsl::Rsa,QSsl::Pem,lineEditPassPhrase->text().toLatin1());
...