ssl - How to read SNI extension in Java? -
i want find host name tls client hello message
. want find host name before java complete handshake transparent ssl proxy
.
is there way find sni extension
value without writing whole ssl handshake
logic ?
is java supports ssl handshake
initial memory buffer ? idea is:
- read tls client hello message, parse , find sni value
- call
sslsocket.starthandshake(initialbuffer)
initial buffer contain tls client hello packet data. java can handshake.
second idea use sslengine class
. seems lot more implementation requirement. assume sslengine
used of async in case don't require it.
third idea implement complete tls protocol
.
which idea better ?
both sslsocket , sslengine lack (quite inexplicable) proper sni support server connections.
i came across same problem myself , ended writing library: tls channel. not that, complete abstraction sslengine, exposed bytechannel. regarding sni, library parsing of first bytes before creating sslengine. user can supply function server channel, select sslcontexts depending on received domain name.
Comments
Post a Comment