Are you sure that SSL is configured on the server side? If so check the port to which SSL is configured at the server.
Main Topics
Browse All TopicsHi Xpert,
I trying to connect to server throught sslsocket, but i got the error message "javax.net.ssl.SSLExceptio
anyone help me on this problem? Here is my code:
import java.net.*;
import java.io.*;
import java.security.*;
import javax.net.ssl.*;
public class sslTesting {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Usage:
return;
}
int port = 4444;
String host = args[0];
try {
Security.addProvider(new com.sun.net.ssl.internal.s
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefaul
SSLSocket mysocket = (SSLSocket)factory.createS
mysocket.setTcpNoDelay(tru
mysocket.startHandshake();
Writer out = new OutputStreamWriter(mysocke
out.write("login:name=unam
out.write("\r\n");
out.flush( );
// read response
BufferedReader in = new BufferedReader(
new InputStreamReader(mysocket
int c;
while ((c = in.read( )) != -1) {
System.out.write(c);
}
out.close( );
in.close( );
mysocket.close( );
} catch (SSLHandshakeException reason){
System.out.println("Handaa
} catch (IOException e) {
System.err.println(e);
}
}
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yesh, the port is correct.., i can connect from vender application to that server, but i am required to build an application for
automate task...,
I use j2se 1.5.. do i need to jsse.jar? as you mention "the client could not understand the server's response ...". how can we display
what server response?
thanks,
ikhmer
Business Accounts
Answer for Membership
by: Ajay-SinghPosted on 2006-08-24 at 05:52:21ID: 17380785
This happens when client could not understand the server's response over ssl. Try upgrading jsse.jar to the latest