/** * Overriding in order to add the client's certificates to ConnectionInfo * Commmands. * * @param command The Command coming in. */ @Override public void doConsume(Object command) { // The instanceof can be avoided, but that would require modifying the // Command clas tree and that would require too much effort right // now. if (command instanceof ConnectionInfo) { ConnectionInfo connectionInfo = (ConnectionInfo)command; connectionInfo.setTransportContext(getPeerCertificates()); } super.doConsume(command); }
@Override public SslTransport createTransport(WireFormat wireFormat, Socket socket, InitBuffer initBuffer) throws IOException { return new SslTransport(wireFormat, (SSLSocket)socket, initBuffer); } }
/** * Overriding to allow for proper configuration through reflection. */ public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { SslTransport sslTransport = (SslTransport)transport.narrow(SslTransport.class); IntrospectionSupport.setProperties(sslTransport, options); Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket."); sslTransport.setSocketOptions(socketOptions); if (sslTransport.isTrace()) { try { transport = TransportLoggerFactory.getInstance().createTransportLogger(transport, sslTransport.getLogWriterName(), sslTransport.isDynamicManagement(), sslTransport.isStartLogging(), sslTransport.getJmxPort()); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + sslTransport.getLogWriterName() + ", reason: " + e, e); } } transport = new InactivityMonitor(transport, format); // Only need the WireFormatNegotiator if using openwire if (format instanceof OpenWireFormat) { transport = new WireFormatNegotiator(transport, (OpenWireFormat)format, sslTransport.getMinmumWireFormatVersion()); } return transport; }
@Override public void doConsume(Object command) { StompFrame frame = (StompFrame) command; if (cachedPeerCerts == null) { cachedPeerCerts = getPeerCertificates(); } frame.setTransportContext(cachedPeerCerts); super.doConsume(command); } };
@Override public void doConsume(Object command) { StompFrame frame = (StompFrame) command; if (cachedPeerCerts == null) { cachedPeerCerts = getPeerCertificates(); } frame.setTransportContext(cachedPeerCerts); super.doConsume(command); } };
public X509Certificate[] getPeerCertificates() { if(next instanceof SslTransport) { X509Certificate[] peerCerts = ((SslTransport)next).getPeerCertificates(); if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; } return null; }
/** * Used to create Transports for this server. * * Overridden to allow the use of SslTransports (instead of TcpTransports). * * @param socket The incoming socket that will be wrapped into the new Transport. * @param format The WireFormat being used. * @return The newly return (SSL) Transport. * @throws IOException */ @Override protected Transport createTransport(Socket socket, WireFormat format) throws IOException { return new SslTransport(format, (SSLSocket)socket); }
@Override public void doConsume(Object command) { StompFrame frame = (StompFrame) command; if (cachedPeerCerts == null) { cachedPeerCerts = getPeerCertificates(); } frame.setTransportContext(cachedPeerCerts); super.doConsume(command); } };
@Override public X509Certificate[] getPeerCertificates() { X509Certificate[] peerCerts = null; if (next instanceof SslTransport) { peerCerts = ((SslTransport) next).getPeerCertificates(); } else if (next instanceof NIOSSLTransport) { peerCerts = ((NIOSSLTransport) next).getPeerCertificates(); } if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; }
/** * Overriding to use SslTransports. */ @Override protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); // see if the path is a local URI location if (path != null && path.length() > 0) { int localPortIndex = path.indexOf(':'); try { Integer.parseInt(path.substring(localPortIndex + 1, path.length())); String localString = location.getScheme() + ":/" + path; localLocation = new URI(localString); } catch (Exception e) { LOG.warn("path isn't a valid local location for SslTransport to use", e); } } SocketFactory socketFactory = createSocketFactory(); return new SslTransport(wf, (SSLSocketFactory) socketFactory, location, localLocation, false); }
@Override public X509Certificate[] getPeerCertificates() { X509Certificate[] peerCerts = null; if (next instanceof SslTransport) { peerCerts = ((SslTransport) next).getPeerCertificates(); } else if (next instanceof NIOSSLTransport) { peerCerts = ((NIOSSLTransport) next).getPeerCertificates(); } if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; }
/** * Overriding to use SslTransports. */ @Override protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); // see if the path is a local URI location if (path != null && path.length() > 0) { int localPortIndex = path.indexOf(':'); try { Integer.parseInt(path.substring(localPortIndex + 1, path.length())); String localString = location.getScheme() + ":/" + path; localLocation = new URI(localString); } catch (Exception e) { LOG.warn("path isn't a valid local location for SslTransport to use", e); } } SocketFactory socketFactory = createSocketFactory(); return new SslTransport(wf, (SSLSocketFactory)socketFactory, location, localLocation, false); }
@Override public X509Certificate[] getPeerCertificates() { X509Certificate[] peerCerts = null; if (next instanceof SslTransport) { peerCerts = ((SslTransport) next).getPeerCertificates(); } if (next instanceof NIOSSLTransport) { peerCerts = ((NIOSSLTransport)next).getPeerCertificates(); } if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; }
@Override public SslTransport createTransport(WireFormat wireFormat, Socket socket, InitBuffer initBuffer) throws IOException { return new SslTransport(wireFormat, (SSLSocket)socket, initBuffer); } }
@Override public X509Certificate[] getPeerCertificates() { X509Certificate[] peerCerts = null; if (next instanceof SslTransport) { peerCerts = ((SslTransport) next).getPeerCertificates(); } if (next instanceof NIOSSLTransport) { peerCerts = ((NIOSSLTransport)next).getPeerCertificates(); } if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; }
@Override public SslTransport createTransport(WireFormat wireFormat, Socket socket, InitBuffer initBuffer) throws IOException { return new SslTransport(wireFormat, (SSLSocket)socket, initBuffer); } }
@Override public X509Certificate[] getPeerCertificates() { X509Certificate[] peerCerts = null; if (next instanceof SslTransport) { peerCerts = ((SslTransport) next).getPeerCertificates(); } if (next instanceof NIOSSLTransport) { peerCerts = ((NIOSSLTransport)next).getPeerCertificates(); } if (trace && peerCerts != null) { LOG.debug("Peer Identity has been verified\n"); } return peerCerts; }
@Override public SslTransport createTransport(WireFormat wireFormat, Socket socket, InitBuffer initBuffer) throws IOException { return new SslTransport(wireFormat, (SSLSocket)socket, initBuffer); } }
/** * Overriding in order to add the client's certificates to ConnectionInfo * Commmands. * * @param command The Command coming in. */ @Override public void doConsume(Object command) { // The instanceof can be avoided, but that would require modifying the // Command clas tree and that would require too much effort right // now. if (command instanceof ConnectionInfo) { ConnectionInfo connectionInfo = (ConnectionInfo)command; connectionInfo.setTransportContext(getPeerCertificates()); } super.doConsume(command); }
/** * Used to create Transports for this server. * * Overridden to allow the use of SslTransports (instead of TcpTransports). * * @param socket The incoming socket that will be wrapped into the new Transport. * @param format The WireFormat being used. * @return The newly return (SSL) Transport. * @throws IOException */ @Override protected Transport createTransport(Socket socket, WireFormat format) throws IOException { return new SslTransport(format, (SSLSocket)socket); }