如何使用ssl证书使用SOAP请求?

时间:2018-07-30 07:13:17

标签: android reactjs react-native soap ssl-certificate

我想在本机响应中使用saop请求。但是问题出在后端的自签名ssl证书中。那么问题来了。有什么方法可以跳过此验证证书吗?

我使用以下代码:

xmlhttp = new XMLHttpRequest();
            xmlhttp.open('POST', 'https://xxx.xxx.xxx.xxx:1443/orawsv/user/WSS_USER_LOGIN/GETLOGIN', true);

            // build SOAP request
            sr =
                '<?xml version="1.0" encoding="utf-8"?>' +
                '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"'+
                ' xmlns:get="http://xmlns.oracle.com/orawsv/user/WSS_USER_LOGIN/GETLOGIN">'+
                ' <soapenv:Header/>'+
                '   <soapenv:Body>'+
                    '<soapenv:Body>' +
                        '<get:CGETLOGIN_OUT-GETLOGINInput>'+
         '<get:SQLMSGIN-GETLOGIN_IN-CIN>'+
          '  <get:GETLOGIN_IN>'+
          '     <get:LOGIN>login</get:LOGIN>'+
            '   <get:PASSWORD>password</get:PASSWORD>'+
          '  </get:GETLOGIN_IN>'+
         '</get:SQLMSGIN-GETLOGIN_IN-CIN>'+
      '</get:CGETLOGIN_OUT-GETLOGINInput>'+
                    '</soapenv:Body>' +
                '</soapenv:Envelope>';

            xmlhttp.onreadystatechange = function () {

                              console.log(xmlhttp.responseText);
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status == 200) {
                        console.log('done. use console to see network response');
                          console.log(xmlhttp.responseText);
                    }
                }
            }
            xmlhttp.setRequestHeader('Content-Type', 'text/xml');
            xmlhttp.send(sr);
            console.log('send');
        }

完整的错误是:

  

java.security.cert.CertPathValidatorException:的信任锚   找不到认证路径。

0 个答案:

没有答案