Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StartTLS command #95

Open
agnauck opened this issue Aug 14, 2020 · 2 comments
Open

StartTLS command #95

agnauck opened this issue Aug 14, 2020 · 2 comments

Comments

@agnauck
Copy link

agnauck commented Aug 14, 2020

I am currently evaluating BedrockFramework for an XMPP protocol implementation. XMPP requires StartTls on the protocol level.
Is there a way currently to start a TCP connection in plain and upgrade it to TLS later when StartTls gets negotiated on the protocol level?

I was studying the source codes of the TLS Middleware. My assumption is that its always securing the connection immediately when the socket connects here:

public async Task OnConnectionAsync(ConnectionContext context)

Is this correct?

@agnauck
Copy link
Author

agnauck commented Oct 12, 2020

anyone able to help here? Thanks

@DeSebastianSimon
Copy link

I did this for a proprietor protocol where the client sends a bunch of telegrams, then a request telegramm before starting the tls authentification. My solution just sits in the connection handler and isn't using the middelware though.

The way i did this was:

  • Stop reading and writing from the connection.

  • Advance the input transport to the point after the request telegram (so that the ssl "hello" blob is right at the start).

  • Create a new SslDuplexPipe from the transport.

  • Authenticate the the stream on the new pipe.

  • Create new reader and writer from the authenticated pipe.

  • Only use the new reader/writer from here on out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants