Giter Site home page Giter Site logo

Support client SNI about reactor-netty HOT 5 CLOSED

mheath avatar mheath commented on May 9, 2024
Support client SNI

from reactor-netty.

Comments (5)

mheath avatar mheath commented on May 9, 2024

I hacked this together: mheath@2c2b80d and it works. I'm not sure that getting the remote address for the SslHandler from the Channel is the best/right way to do it or not.

from reactor-netty.

mp911de avatar mp911de commented on May 9, 2024

+1 for SNI. Using the channel's remote address could conflict with proxy handlers. An unresolved InetSocketAddress with the intended endpoint address (derived from a URI or similar) should work.

from reactor-netty.

mheath avatar mheath commented on May 9, 2024

@mp911de When you talk about a 'proxy handler' are you referring to an HTTP proxy or some kind of Java proxy?

If it's a HTTP proxy, you would have to use the proxy's address in the SNI request since the client would be doing TLS with the proxy and the proxy would be doing TLS with the intended endpoint. If the client were to send the intended endpoint's address and the proxy is using SNI, the TLS negotiation would fail.

from reactor-netty.

mp911de avatar mp911de commented on May 9, 2024

Sorry for being imprecise. The HTTP proxy endpoint vs. intended endpoint was my issue which you described above.

from reactor-netty.

simonbasle avatar simonbasle commented on May 9, 2024

@mheath after looking a bit more in depth at the issue with @smaldini, we don't think the approach of using the Channel's SocketAddress is the correct one.

I have put together a change that:

  • captures the SocketAddress originally provided by the client (so not the resolved and actually connected address, but rather the one targeted by eg. a GET).
  • adds a getSNI() method to ContextHandler which is used when calling the addSslAndLogHandlers static method. By default it returns null, which ignores SNI
  • implements getSNI so that http client context implementations extract the hostname and port out of the captured SocketAddress (provided it is not null and is an InetSocketAddress), thus enabling SNI for the clients.

from reactor-netty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.