actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

Unable to use a custom Acceptor

Open lovasoa opened this issue 1 year ago • 1 comments

I was trying to make an https server that would auto-generate ssl certificate with TLS-ALPN-01. There is a crate available that implements it: rustls-acme, but it seems impossible to use it with actix-web, because of the limitations in what the HttpServer type exposes.

Expected Behavior

The user can implement the binding between TCP connections and byte streams however they want, without being limited to a list of "officially supported" SSL implementations.

Current Behavior

Currently, the only way to accept connections to an HTTPServer is to use one of these methods:

Looking at their source code, there seems to be some code duplication between them. And having to support two different versions of rustls independently inside of actix-web itself also seems sub-optimal.

Possible Solution

Define a public Acceptor trait, implement it for openssl's SslAcceptor and rustl's ServerConfig, and maybe on any function that returns a Stream<AsyncRead + AsyncWrite> ?

Context

I want SQLPage to offer HTTPS support with completely transparent certificate management.

lovasoa avatar Nov 22 '23 15:11 lovasoa