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
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928617#3928617
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928617
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user