PDA

View Full Version : load https: Self Signed Certificate encryption



buleron
23rd May 2015, 10:46
I use soap to call web service with encryption certificate deploying in Android
how to open https , load certificate
any idea?

I'm using this code below , but appears "Network transport error (6): SSL handshake failed" error


void QtSoapHttpTransport::setHost(const QString &host, bool useSecureHTTP, int port)
{
url.setHost(host);
url.setScheme(useSecureHTTP ? QLatin1String("https") : QLatin1String("http"));
https = useSecureHTTP;
if (port)
url.setPort(port);
else
url.setPort(useSecureHTTP ? 443 : 80);
}

/*!
Sets the HTTP header SOAPAction to \a action.
*/
void QtSoapHttpTransport::setAction(const QString &action)
{
soapAction = action;
}

/*!
Submits the SOAP message \a request to the path \a path on the
HTTP server set using setHost().
*/
void QtSoapHttpTransport::submitRequest(QtSoapMessage &request, const QString &path)
{
QNetworkRequest networkReq;
networkReq.setHeader(QNetworkRequest::ContentTypeH eader, QLatin1String("text/xml;charset=utf-8"));
networkReq.setRawHeader("SOAPAction", soapAction.toLatin1());
url.setPath(path);
networkReq.setUrl(url);

soapResponse.clear();
qDebug() << url.port();
qDebug() << url.host();

networkRep = networkMgr.post(networkReq, request.toXmlString().toUtf8().constData());
}