try {
int port = 225;
String hostname = "hotdir.biz";
SocketFactory socketFactory = SSLSocketFactory.getDefault();
Socket socket = socketFactory.createSocket(hostname, port);
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
in.close();
out.close();
} catch(IOException e) {
}
Creating an SSL Server Socket(Java SSL tutorial)
try {
int port = 225;
ServerSocketFactory ssocketFactory = SSLServerSocketFactory.getDefault();
ServerSocket ssocket = ssocketFactory.createServerSocket(port);
Socket socket = ssocket.accept();
InputStream in = socket.getInputStream();
OutputStream out = socket.getOutputStream();
in.close();
out.close();
} catch(IOException e) {
}
Bookmarks