qt qwebsocket 连接wss://

if (m_url.indexOf("wss://") >= 0) {
        QSslConfiguration sslConfiguration = m_pWebSocket->sslConfiguration();
        sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyPeer);
        sslConfiguration.setProtocol(QSsl::TlsV1SslV3);
        m_pWebSocket->setSslConfiguration(sslConfiguration);
    }

还要安装openssl,并把openssl下libeay32.dll和ssleay32.dll放到qt bin目录下

posted @ 2021-06-10 17:05  一夜梦想  阅读(1341)  评论(0编辑  收藏  举报