I’m trying to use ssl sockets in a working java networking program.
I replaced two lines of code
//Socket socket = new Socket(ipAddress, port);
SSLSocket socket = (SSLSocket)SSLSocketFactory.getDefault().createSocket(ipAddress, port);
and
//serverSocket = new ServerSocket();
serverSocket = (SSLServerSocket)SSLServerSocketFactory.getDefault().createServerSocket();
serverSocket.setReuseAddress(true);
serverSocket.bind(new InetSocketAddress(port));
while (true) {
Socket clientSocket = serverSocket.accept();
......
I get an exception: “connection refused: Connect”
The program was working with the commented code. And now it doesn’t. What do I need to do to use SSLSockets instead of standard Sockets ?
If relevant, the server is running on localhost == windows vista.
Bruno gave me the answer in the comments: I haven’t configured any keystore.