1 25 26 package org.ofbiz.service.rmi.socket.ssl; 27 28 import java.io.IOException ; 29 import java.io.Serializable ; 30 import java.net.Socket ; 31 import java.rmi.server.RMIClientSocketFactory ; 32 import java.security.GeneralSecurityException ; 33 import javax.net.ssl.SSLSocketFactory; 34 35 import org.ofbiz.base.util.Debug; 36 import org.ofbiz.base.util.SSLUtil; 37 38 45 public class SSLClientSocketFactory implements RMIClientSocketFactory , Serializable { 46 47 public static final String module = SSLClientSocketFactory.class.getName(); 48 49 public Socket createSocket(String host, int port) throws IOException { 50 try { 51 SSLSocketFactory factory = SSLUtil.getSSLSocketFactory(); 52 return factory.createSocket(host, port); 53 } catch (GeneralSecurityException e) { 54 Debug.logError(e, module); 55 throw new IOException (e.getMessage()); 56 } 57 } 58 } 59 | Popular Tags |