Java and HTTPS url connection without downloading certificate

前端 未结 6 446
自闭症患者
自闭症患者 2020-11-27 12:32

This code connects to a HTTPS site and I am assuming I am not verifying the certificate. But why don\'t I have to install a certificate locally for the site? Shouldn\'t I

6条回答
  •  迷失自我
    2020-11-27 13:02

    If you are using any Payment Gateway to hit any url just to send a message, then i used a webview by following it : How can load https url without use of ssl in android webview

    and make a webview in your activity with visibility gone. What you need to do : just load that webview.. like this:

     webViewForSms.setWebViewClient(new SSLTolerentWebViewClient());
                    webViewForSms.loadUrl(" https://bulksms.com/" +
                            "?username=test&password=test@123&messageType=text&mobile="+
                            mobileEditText.getText().toString()+"&senderId=ATZEHC&message=Your%20OTP%20for%20A2Z%20registration%20is%20124");
    

    Easy.

    You will get this: SSLTolerentWebViewClient from this link: How can load https url without use of ssl in android webview

提交回复
热议问题