Jon Lindeheim
Jon Lindeheim

Reputation: 582

Use chacha20-poly1305 symmectric algorithm for HTTPS in .NET

Does anyone know if it's possible to use a cipher suite with chacha20, for example TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 in a desktop client written in .NET (v4.6.2) running on Windows 10?

My scenario is that I have a client that needs to talk to a server over TLS, where the server runs on an embedded device, which would benefit a lot, performance wise, if I could use chacha20 instead of AES.

I'm hoping to be able to use the existing HttpClient or WebClient classes.

Upvotes: 1

Views: 1019

Answers (1)

Paul Turner
Paul Turner

Reputation: 39675

In the .NET Framework, the built-in support for HTTP (and by extension TLS) is handled by ServicePoint class. You can configure basic parameters like the TLS versions to support via the ServicePointManager class, but this class doesn't offer any extension points for supplying a custom algorithm.

The Framework delegates to Windows to perform TLS handshakes, including the supported algorithms. If Windows were to support chacha20, you might have a better chance at this, but to my knowledge it does not.

The only way I could consider achieving this now would be to provide a custom implementation of HttpMessageHandler which has its own transport implementation around a naked socket.

Upvotes: 3

Related Questions