datatheoz

HttpsURLConnection Override

Oct 27th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 HostnameVerifier hostnameVerifier = new HostnameVerifier() {
  2.                     @Override
  3.                     public boolean verify(String hostname, SSLSession session) {
  4.                         return true;
  5.                     }
  6.                 };
  7.  
  8.                 HttpsURLConnection httpsConn = (HttpsURLConnection)urlConnection;
  9.                 httpsConn.setHostnameVerifier(hostnameVerifier);
Add Comment
Please, Sign In to add comment