qt.network.ssl:QSslSocket :: connectToHostEncrypted:TLS初始化失败

时间:2019-05-16 08:35:48

标签: qt openssl xmlhttprequest qml

因此,当我尝试发送XMLHttpRequest时得到qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

我使用Qt 5.12.2,imsvc2017_64。我该如何解决这个问题?

function requestCall(type){

    var http = new XMLHttpRequest()
    var url = "https://******";
    var params = ""
    params = "operator_id=1&call_id="+call_id;
    console.log("Request (type): "+(type))
    http.open("POST", url, true);
    http.setRequestHeader("Content-type", "application/x-www-form- urlencoded");
    http.setRequestHeader("Connection", "close");
    http.onreadystatechange = function() { }
    http.send(params);
}

1 个答案:

答案 0 :(得分:0)

添加对Android的OpenSSL支持
https://doc.qt.io/qt-5/android-openssl-support.html