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:

  1. read tls client hello message, parse , find sni value
  2. 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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -