Qt版本为:Qt 5.4.0 MinGW 32bit && Windos7
在使用QtNetwork模块连接https网站时出现了
QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_get_error
发现是OpenSSL的问题,去下载对应位数的OpenSSL (默认安装,一路next到底就行了,Qt一般是32位的,OpenSSL一般也是安装32位的)。
在代码方面的话,类似于下面,设置QSslConfiguration
QNetworkRequest mRequest;
QSslConfiguration config;
config.setPeerVerifyMode(QSslSocket::VerifyNone);
config.setProtocol(QSsl::SslV2);
mRequest.setSslConfiguration(config);