This content has been marked as final.
Show 1 reply
-
1. Re: JBoss SSL Setup for remote clients
bparanj Mar 7, 2006 5:24 PM (in response to bparanj)I resolved this error message. SSL setup instructions on Wiki works if I use localhost but fails if I run it from a remote machine and use the machine's name.
I modified the Http client based on the Sun's tutorial. Here is the fix:import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; public class ReadHttpsURL3 { public static void main(String[] argv) throws Exception { URL url = new URL(argv[0]); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setHostnameVerifier(new MyVerified()); connection.setDoOutput(true); BufferedReader in = new BufferedReader( new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { System.out.println(line); } in.close(); } } class MyVerified implements HostnameVerifier { public boolean verify(String hostname, SSLSession session) { return true ; } }
Also make sure that you use Sun's JDK 1.4.2 or higher. I was getting some weird errors due to IBM's JVM.
Hope this helps someone.
Bala
http://www.ProblemSolvingSkill.net