private void needReconfigureTLS() { for (Connection con : conns) if (con.isTls()) con.needRebind(); sslContext = null; }
private void needReconfigureTLS() { for (Connection con : conns) if (con.isTls()) con.needRebind(); sslContext = null; }
public boolean isCompatible(Connection remoteConn) { if (remoteConn.protocol != protocol) return false; if (!protocol.isTCP()) return true; if (!isTls()) return !remoteConn.isTls(); return hasCommon(remoteConn.getTlsProtocols(), getTlsProtocols()) && hasCommon(remoteConn.tlsCipherSuites, tlsCipherSuites); }
public static boolean configureTLSCipher(Connection conn, CommandLine cl) throws ParseException { if (cl.hasOption("tls")) conn.setTlsCipherSuites( "SSL_RSA_WITH_NULL_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-null")) conn.setTlsCipherSuites("SSL_RSA_WITH_NULL_SHA"); else if (cl.hasOption("tls-3des")) conn.setTlsCipherSuites("SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-aes")) conn.setTlsCipherSuites( "TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-cipher")) conn.setTlsCipherSuites(cl.getOptionValues("tls-cipher")); return conn.isTls(); }
public boolean isCompatible(Connection remoteConn) { if (remoteConn.protocol != protocol) return false; if (!protocol.isTCP()) return true; if (!isTls()) return !remoteConn.isTls(); return hasCommon(remoteConn.getTlsProtocols(), getTlsProtocols()) && hasCommon(remoteConn.tlsCipherSuites, tlsCipherSuites); }
public static boolean configureTLSCipher(Connection conn, CommandLine cl) throws ParseException { if (cl.hasOption("tls")) conn.setTlsCipherSuites( "SSL_RSA_WITH_NULL_SHA", "TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-null")) conn.setTlsCipherSuites("SSL_RSA_WITH_NULL_SHA"); else if (cl.hasOption("tls-3des")) conn.setTlsCipherSuites("SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-aes")) conn.setTlsCipherSuites( "TLS_RSA_WITH_AES_128_CBC_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"); else if (cl.hasOption("tls-cipher")) conn.setTlsCipherSuites(cl.getOptionValues("tls-cipher")); return conn.isTls(); }
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); } }
void configure(DcmLdap main, CommandLine cl) throws ParseException { String aeAtHostPort = cl.getOptionValue(name()); String[] aeHostPort = StringUtils.split(aeAtHostPort , '@'); if (aeHostPort.length < 2) throw invalidConn(); String[] hostPort = StringUtils.split(aeHostPort[1], ':'); if (hostPort.length < 2) throw invalidConn(); Connection conn; try { conn = new Connection(cl.getOptionValue("conn"), hostPort[0], Integer.parseInt(hostPort[1])); } catch (NumberFormatException e) { throw invalidConn(); } CLIUtils.configureTLSCipher(conn, cl); if (conn.getCommonName() == null) conn.setCommonName(conn.isTls() ? "dicom-tls" : "dicom"); main.setDeviceName(cl.getOptionValue("dev")); main.setDeviceDescription(cl.getOptionValue("dev-desc")); main.setDeviceType(cl.getOptionValue("dev-type")); main.setAETitle(aeHostPort[0]); main.setAEDescription(cl.getOptionValue("ae-desc")); main.setConnection(conn); }
void configure(DcmLdap main, CommandLine cl) throws ParseException { String aeAtHostPort = cl.getOptionValue(name()); String[] aeHostPort = StringUtils.split(aeAtHostPort , '@'); if (aeHostPort.length < 2) throw invalidConn(); String[] hostPort = StringUtils.split(aeHostPort[1], ':'); if (hostPort.length < 2) throw invalidConn(); Connection conn; try { conn = new Connection(cl.getOptionValue("conn"), hostPort[0], Integer.parseInt(hostPort[1])); } catch (NumberFormatException e) { throw invalidConn(); } CLIUtils.configureTLSCipher(conn, cl); if (conn.getCommonName() == null) conn.setCommonName(conn.isTls() ? "dicom-tls" : "dicom"); main.setDeviceName(cl.getOptionValue("dev")); main.setDeviceDescription(cl.getOptionValue("dev-desc")); main.setDeviceType(cl.getOptionValue("dev-type")); main.setAETitle(aeHostPort[0]); main.setAEDescription(cl.getOptionValue("ae-desc")); main.setConnection(conn); }
s.connect(remoteConn.getEndPoint(), connectTimeout); if (isTls()) s = createTLSSocket(s, remoteConn); if (monitor != null)
s.connect(remoteConn.getEndPoint(), connectTimeout); if (isTls()) s = createTLSSocket(s, remoteConn); if (monitor != null)