qt将http更改为https

1. 在qt中将http更改为https只需将

      request.setUrl(QNetworkRequest(QUrl(url)));   
更改如下:

        QNetworkRequest request;
        QSslConfiguration config;
        config.setPeerVerifyMode(QSslSocket::VerifyNone);
        config.setProtocol(QSsl::TlsV1SslV3);
        request.setSslConfiguration(config);
 
  
        request.setUrl(QUrl(url));

2.程序执行出现打印如下信息:   

   qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

     qt.network.ssl: QSslSocket: cannot call unresolved function TLSv1_client_method

   qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new

   qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init

   qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error

3.拷贝D:\mingwQt\Qt5.5.0\Tools\mingw492_32\opt\bin目录下的libeay32.dll和ssleay32.dll到目录D:\mingwQt\Qt5.5.0\5.5\mingw492_32\bin下。

   

你可能感兴趣的:(qt)