hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Is a NHttpServerConnection encrypted?
Date Sat, 06 May 2017 08:43:50 GMT
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-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message