s2n-tls
s2n-tls copied to clipboard
feat(bindings): Add hyper compatibility crate
Resolved issues:
Part of https://github.com/aws/s2n-tls/issues/4618
Description of changes:
Adds a new s2n-tls-hyper crate to provide compatibility with hyper clients.
This crate makes it easier to use s2n-tls as the TLS provider in hyper by exposing an HttpsConnector
struct that implements tower_service::Service
, allowing for it to be provided to the hyper client builder.
This crate is based on similar crates that provide hyper compatibility to TLS implementations, such as to rustls, via hyper-rustls, and native-tls, via hyper-tls.
Call-outs:
- The
MaybeHttpsStream
is currently definitely an https stream, but exists as an enum so it can later be configured to use TCP without TLS. - There currently isn't any purpose for the
HttpsConnector
Builder, but I intend to add at least one option to it later.
Testing:
I added a simple get request test just to check that the HttpsConnector
seems to be working, but I plan to add more sophisticated tests in another PR.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.