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 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)); }
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 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 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); } }
checkCompatible(remoteConn); SocketAddress bindPoint = getClientBindPoint(); String remoteHostname = remoteConn.getHostname(); int remotePort = remoteConn.getPort(); LOG.info("Initiate connection from {} to {}:{}",
checkCompatible(remoteConn); SocketAddress bindPoint = getClientBindPoint(); String remoteHostname = remoteConn.getHostname(); int remotePort = remoteConn.getPort(); LOG.info("Initiate connection from {} to {}:{}",
activeParticipants[1] = new ActiveParticipantBuilder.Builder( log.getDevice().getDeviceName(), log.getConnections().get(0).getHostname()) .userIDTypeCode(AuditMessages.UserIDTypeCode.DeviceName) .altUserID(AuditLogger.processID()).build();
activeParticipants[1] = new ActiveParticipantBuilder.Builder( log.getDevice().getDeviceName(), log.getConnections().get(0).getHostname()) .userIDTypeCode(AuditMessages.UserIDTypeCode.DeviceName) .altUserID(AuditLogger.processID()).build();
activeParticipants[1] = new ActiveParticipantBuilder.Builder( auditLogger.getDevice().getDeviceName(), auditLogger.getConnections().get(0).getHostname()) .userIDTypeCode(AuditMessages.UserIDTypeCode.DeviceName) .altUserID(AuditLogger.processID()).build();
activeParticipants[1] = new ActiveParticipantBuilder.Builder( auditLogger.getDevice().getDeviceName(), auditLogger.getConnections().get(0).getHostname()) .userIDTypeCode(AuditMessages.UserIDTypeCode.DeviceName) .altUserID(AuditLogger.processID()).build();
private List<ModificationItem> storeDiffs(ConfigurationChanges.ModifiedObject ldapObj, Connection a, Connection b, List<ModificationItem> mods) { LdapUtils.storeDiffObject(ldapObj, mods, "dicomHostname", a.getHostname(), b.getHostname(), null); LdapUtils.storeDiff(ldapObj, mods, "dicomPort", a.getPort(),
private List<ModificationItem> storeDiffs(ConfigurationChanges.ModifiedObject ldapObj, Connection a, Connection b, List<ModificationItem> mods) { LdapUtils.storeDiffObject(ldapObj, mods, "dicomHostname", a.getHostname(), b.getHostname(), null); LdapUtils.storeDiff(ldapObj, mods, "dicomPort", a.getPort(),
attrs.put(objectclass); 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());
private void writeTo(Connection conn, JsonWriter writer, boolean extended) { writer.writeStartObject(); 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());
private void writeTo(Connection conn, JsonWriter writer, boolean extended) { writer.writeStartObject(); 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());
attrs.put(objectclass); 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());