1 7 8 package org.objectweb.rmijdbc; 9 10 import java.net.*; 11 import java.io.*; 12 import javax.net.ssl.*; 13 import java.rmi.server.*; 15 16 19 public class RJSSLClientSocketFactory implements RMIClientSocketFactory, Serializable { 20 public Socket createSocket(String host, int port) 21 throws IOException { 22 SSLSocketFactory factory = 23 (SSLSocketFactory) SSLSocketFactory.getDefault(); 24 25 SSLSocket sslSocket = null; 26 try { 27 sslSocket = 28 (SSLSocket) factory.createSocket(host, port); 29 30 32 } catch(IOException e) { 37 e.printStackTrace(); 38 System.exit(2); 39 } 40 return sslSocket; 41 } 42 } 43 | Popular Tags |