sun.security.validator.ValidatorException

解决ssl验证证书未通过问题。

 

忽略服务器证书.

 

 private void trustAllHttpsCertificates() throws Exception { javax.net.ssl.TrustManager[] trustAllCerts =                 new javax.net.ssl.TrustManager[1]; javax.net.ssl.TrustManager tm = new miTM(); trustAllCerts[0] = tm; javax.net.ssl.SSLContext sc =                 javax.net.ssl.SSLContext.getInstance("SSL"); sc.init(null,trustAllCerts,null); javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(                              sc.getSocketFactory()); }

你可能感兴趣的:(sun.security.validator.ValidatorException)