private SSLSocket createTLSSocket(Socket s, Connection remoteConn) throws GeneralSecurityException, IOException { SSLContext sslContext = device.sslContext(); SSLSocketFactory sf = sslContext.getSocketFactory(); SSLSocket ssl = (SSLSocket) sf.createSocket(s, remoteConn.getHostname(), remoteConn.getPort(), true); ssl.setEnabledProtocols( intersect(remoteConn.getTlsProtocols(), getTlsProtocols())); ssl.setEnabledCipherSuites( intersect(remoteConn.tlsCipherSuites, tlsCipherSuites)); ssl.startHandshake(); return ssl; }
private SSLSocket createTLSSocket(Socket s, Connection remoteConn) throws GeneralSecurityException, IOException { SSLContext sslContext = device.sslContext(); SSLSocketFactory sf = sslContext.getSocketFactory(); SSLSocket ssl = (SSLSocket) sf.createSocket(s, remoteConn.getHostname(), remoteConn.getPort(), true); ssl.setEnabledProtocols( intersect(remoteConn.getTlsProtocols(), getTlsProtocols())); ssl.setEnabledCipherSuites( intersect(remoteConn.tlsCipherSuites, tlsCipherSuites)); ssl.startHandshake(); return ssl; }
public TCPListener(Connection conn, TCPProtocolHandler handler) throws IOException, GeneralSecurityException { try { this.conn = conn; this.handler = handler; ss = conn.isTls() ? createTLSServerSocket(conn) : new ServerSocket(); conn.setReceiveBufferSize(ss); ss.bind(conn.getBindPoint(), conn.getBacklog()); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); } catch (IOException e) { throw new IOException("Unable to start TCPListener on "+conn.getHostname()+":"+conn.getPort(), e); } }
public TCPListener(Connection conn, TCPProtocolHandler handler) throws IOException, GeneralSecurityException { try { this.conn = conn; this.handler = handler; ss = conn.isTls() ? createTLSServerSocket(conn) : new ServerSocket(); conn.setReceiveBufferSize(ss); ss.bind(conn.getBindPoint(), conn.getBacklog()); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); } catch (IOException e) { throw new IOException("Unable to start TCPListener on "+conn.getHostname()+":"+conn.getPort(), e); } }
public static String dnOf(Connection conn, String deviceDN) { String cn = conn.getCommonName(); return (cn != null) ? LdapUtils.dnOf("cn", cn , deviceDN) : (conn.isServer() ? LdapUtils.dnOf("dicomHostname", conn.getHostname(), "dicomPort", Integer.toString(conn.getPort()), deviceDN) : LdapUtils.dnOf("dicomHostname", conn.getHostname(), deviceDN)); }
public static String dnOf(Connection conn, String deviceDN) { String cn = conn.getCommonName(); return (cn != null) ? LdapUtils.dnOf("cn", cn , deviceDN) : (conn.isServer() ? LdapUtils.dnOf("dicomHostname", conn.getHostname(), "dicomPort", Integer.toString(conn.getPort()), deviceDN) : LdapUtils.dnOf("dicomHostname", conn.getHostname(), deviceDN)); }
SocketAddress bindPoint = getClientBindPoint(); String remoteHostname = remoteConn.getHostname(); int remotePort = remoteConn.getPort(); LOG.info("Initiate connection from {} to {}:{}", bindPoint, remoteHostname, remotePort);
SocketAddress bindPoint = getClientBindPoint(); String remoteHostname = remoteConn.getHostname(); int remotePort = remoteConn.getPort(); LOG.info("Initiate connection from {} to {}:{}", bindPoint, remoteHostname, remotePort);
LdapUtils.storeNotNullOrDef(ldapObj, attrs, "cn", conn.getCommonName(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomHostname", conn.getHostname(), null); LdapUtils.storeNotDef(ldapObj, attrs, "dicomPort", conn.getPort(), Connection.NOT_LISTENING); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomTLSCipherSuite", conn.getTlsCipherSuites()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", conn.getInstalled(), null);
writer.writeNotNullOrDef("cn", conn.getCommonName(), null); writer.writeNotNullOrDef("dicomHostname", conn.getHostname(), null); writer.writeNotDef("dicomPort", conn.getPort(), Connection.NOT_LISTENING); writer.writeNotEmpty("dicomTLSCipherSuite", conn.getTlsCipherSuites()); writer.writeNotNull("dicomInstalled", conn.getInstalled());
writer.writeNotNullOrDef("cn", conn.getCommonName(), null); writer.writeNotNullOrDef("dicomHostname", conn.getHostname(), null); writer.writeNotDef("dicomPort", conn.getPort(), Connection.NOT_LISTENING); writer.writeNotEmpty("dicomTLSCipherSuite", conn.getTlsCipherSuites()); writer.writeNotNull("dicomInstalled", conn.getInstalled());
LdapUtils.storeNotNullOrDef(ldapObj, attrs, "cn", conn.getCommonName(), null); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomHostname", conn.getHostname(), null); LdapUtils.storeNotDef(ldapObj, attrs, "dicomPort", conn.getPort(), Connection.NOT_LISTENING); LdapUtils.storeNotEmpty(ldapObj, attrs, "dicomTLSCipherSuite", conn.getTlsCipherSuites()); LdapUtils.storeNotNullOrDef(ldapObj, attrs, "dicomInstalled", conn.getInstalled(), null);