001package ca.uhn.hl7v2.hoh.sockets; 002 003import java.io.IOException; 004import java.net.ServerSocket; 005import java.net.Socket; 006 007import javax.net.ssl.SSLServerSocketFactory; 008import javax.net.ssl.SSLSocketFactory; 009 010/** 011 * Socket Factory which creates an encrypted TLS/SSL socket 012 */ 013public class TlsSocketFactory implements ISocketFactory { 014 015 /** 016 * {@inheritDoc} 017 */ 018 public Socket createClientSocket() throws IOException { 019 return SSLSocketFactory.getDefault().createSocket(); 020 } 021 022 /** 023 * {@inheritDoc} 024 */ 025 public ServerSocket createServerSocket() throws IOException { 026 return SSLServerSocketFactory.getDefault().createServerSocket(); 027 } 028 029 030}