Unable to use a custom Acceptor
- Ngôn ngữ chính
- Rust
- Star
- 24.8k
- Fork
- 1.9k
- Merge trung bình
- 23 giờ 10 phút
- Pull request đã merge (30 ngày)
- 26
Mô tả
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](https://github.com/FlorianUekermann/rustls-acme), but it seems [impossible to use it with actix-web](https://github.com/FlorianUekermann/rustls-acme/issues/54), 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:
- [listen](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen)
- [listen_auto_h2c](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen_auto_h2c)
- [listen_openssl](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen_openssl)
- [listen_rustls](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen_rustls)
- [listen_rustls_0_21](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen_rustls_0_21)
- [listen_uds](https://docs.rs/actix-web/4.4.0/actix_web/struct.HttpServer.html#method.listen_uds)
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` ?
## Context
I want [SQLPage](https://github.com/lovasoa/SQLpage) to offer HTTPS support with completely transparent certificate management.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start by comparing the HttpServer entry points named in the issue: listen, listen_auto_h2c, listen_openssl, listen_rustls, listen_rustls_0_21, and listen_uds, including their duplicated connection-acceptance logic. Done means a custom acceptor can bind TCP connections to async byte streams while the existing supported bindings continue to work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust
- Lĩnh vực
- api, backend
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100