Hostname in certificate didn't match?

前端 未结 5 1102
挽巷
挽巷 2020-12-13 11:37

I try to connect to a server with a self-signed certificate. I use this code to accept all certificates.

public class CertificateAcceptor {

    public void          


        
5条回答
  •  無奈伤痛
    2020-12-13 12:19

    Have you tried calling setDefaultHostnameVerifier of HttpsURLConnection.

    See this link for an example: Accepting a certificate for HTTPs on Android

提交回复
热议问题