Adding SSL flag and client certificate to web request object
This commit is contained in:
parent
2556552e09
commit
a11d78befe
|
@ -62,6 +62,9 @@ posting events. It is reentrant for all other functionality.
|
|||
#include <QThread>
|
||||
#include <qxtmetaobject.h>
|
||||
#include <QTcpSocket>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#include <QSslSocket>
|
||||
#endif
|
||||
|
||||
#ifndef QXT_DOXYGEN_RUN
|
||||
class QxtHttpSessionManagerPrivate : public QxtPrivate<QxtHttpSessionManager>
|
||||
|
@ -366,6 +369,13 @@ void QxtHttpSessionManager::incomingRequest(quint32 requestID, const QHttpReques
|
|||
if (socket)
|
||||
{
|
||||
event->remoteAddress = socket->peerAddress().toString();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
QSslSocket *sslsock = qobject_cast<QSslSocket*>(socket);
|
||||
if(sslsock){
|
||||
event->ssl = true;
|
||||
event->clientCertificate = sslsock->peerCertificate();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
event->method = header.method();
|
||||
event->cookies = cookies;
|
||||
|
|
|
@ -90,7 +90,7 @@ browser.
|
|||
* Constructs a QxtWebRequestEvent for the specified \a sessionID, \a requestID and \a url.
|
||||
*/
|
||||
QxtWebRequestEvent::QxtWebRequestEvent(int sessionID, int requestID, const QUrl& url)
|
||||
: QxtWebEvent(QxtWebEvent::Request, sessionID), requestID(requestID), url(url), originalUrl(url) {}
|
||||
: QxtWebEvent(QxtWebEvent::Request, sessionID), requestID(requestID), url(url), originalUrl(url), ssl(false) {}
|
||||
|
||||
/*!
|
||||
* Destroys the event and any content that may still be associated with it.
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#include <QUrl>
|
||||
#include <QMultiHash>
|
||||
#include <QDateTime>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#include <QSslCertificate>
|
||||
#endif
|
||||
QT_FORWARD_DECLARE_CLASS(QIODevice)
|
||||
class QxtWebContent;
|
||||
|
||||
|
@ -78,6 +81,10 @@ public:
|
|||
QPointer<QxtWebContent> content;
|
||||
QString method;
|
||||
QString remoteAddress;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
QSslCertificate clientCertificate;
|
||||
#endif
|
||||
bool ssl;
|
||||
|
||||
QMultiHash<QString, QString> cookies;
|
||||
QMultiHash<QString, QString> headers;
|
||||
|
|
Loading…
Reference in New Issue
Block a user