On Fri, 2017-05-05 at 15:46 -0700, Gary Gregory wrote: > Hi all, > > I have implemented a > com.rs.seagull.httpmonitor.NHttpReverseProxy.ProxyServiceHandler.conn > ected( > NHttpServerConnection) > > and I want to log whether this is a plain or SSL connection. > > NHttpServerConnection's toString() tells me something like > "127.0.0.1:1102 > <->127.0.0.1:65096" which is nice but does not tell me if the > connection is > encrypted. I'd like to find out in that method when I do the logging. > > Aside from hacking and introspecting into objects to find an > SSLIOSession > and toString()'ing that. > > Can anyone think of clean way to either get this information or > modify > something? > > Gary >
Try getting "http.session.ssl" attribute from the connection context. --- NHttpConnection conn = ... SSLIOSession sslioSession = (SSLIOSession) conn.getContext().getAttribute(SSLIOSession.SESSION_KEY); SSLSession sslSession = sslioSession != null ? sslioSession.getSSLSession() : null; --- Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org