1 22 package org.jboss.invocation.http.interfaces; 23 24 import java.net.HttpURLConnection ; 25 import javax.net.ssl.HostnameVerifier; 26 import javax.net.ssl.HttpsURLConnection; 27 import javax.net.ssl.SSLSession; 28 29 37 public class AnyhostVerifier implements HostnameVerifier 38 { 39 public static void setHostnameVerifier(HttpURLConnection conn) 40 { 41 if( conn instanceof HttpsURLConnection ) 42 { 43 HttpsURLConnection httpsConn = (HttpsURLConnection) conn; 44 AnyhostVerifier verifier = new AnyhostVerifier(); 45 httpsConn.setHostnameVerifier(verifier); 46 } 47 } 48 49 52 public boolean verify(String hostname, SSLSession session) 53 { 54 return true; 55 } 56 57 } 58 | Popular Tags |