如何修复:Android设备上的“ QNetworkReply :: SslHandshakeFailedError”

时间:2019-05-24 12:54:22

标签: android c++ qt https

我尝试使用QNetworkAccessManager和QNetworkRequest访问服务器,但收到错误消息:Android设备上的QNetworkReply :: SslHandshakeFailedError。

我已经编译了适用于Android的OpenSSL库,并将该库添加到了我的Qt项目[https://github.com/ekke/android-openssl-qt]

我正在使用Qt 5.12,Andoird NDK 19,Android API 26

我添加了以下ssl配置:

drawOn

尝试获得答复:

sslConf = QSslConfiguration::defaultConfiguration();
sslConf.setProtocol(QSsl::AnyProtocol);
sslConf.setPeerVerifyMode(QSslSocket::VerifyNone);
sslConf.setCaCertificates({});
QSslConfiguration::setDefaultConfiguration(sslConf);
netAccessManager.setStrictTransportSecurityEnabled(false);

代码在Linux上运行良好,在Linux上出现以下错误:QNetworkReply :: SslHandshakeFailedError。

0 个答案:

没有答案