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

refactor(s2n-tls-hyper): Add HttpsConnector builder #4976

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

goatgoose
Copy link
Contributor

@goatgoose goatgoose commented Dec 11, 2024

Description of changes:

Currently HttpsConnectors are created with HttpsConnector::new and HttpsConnector::new_with_http. This worked because nothing needed to be configured when creating an HttpsConnector.

However, we're going to need a way to bypass TLS so that the same HttpsConnector can be used for both https and http endpoints. It's probably best to disallow this by default, and provide a way to opt-in to this behavior. So, we now need a way to configure HttpsConnectors when creating them. This PR adds an HttpsConnector Builder for this purpose.

Currently there are no builder options. I'll add the TLS bypass option in a followup PR.

Call-outs:

  • This PR removes the HttpsConnector::new_with_http API in favor of HttpsConnector::builder_with_http. Having HttpsConnector::new_with_http in addition to this API seemed excessive, so I removed it. The crate is still unstable so it seemed fine. HttpsConnector::new wasn't broken.
  • Builder already existed in the namespace because of the s2n_tls::connection::Builder. I renamed this type to ConnBuilder.

Testing:

Mostly a refactor. Existing tests should pass. I added a new test that compiles the various ways of creating an HttpsConnector, which makes sure they can be created without any weird manual type annotations.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@goatgoose goatgoose force-pushed the connector-builder branch 3 times, most recently from 4f952bd to 282d4cd Compare December 12, 2024 01:57
@goatgoose goatgoose marked this pull request as ready for review December 12, 2024 02:13
@goatgoose goatgoose enabled auto-merge December 16, 2024 15:24
@goatgoose goatgoose added this pull request to the merge queue Dec 16, 2024
Merged via the queue into aws:main with commit a70b2b0 Dec 16, 2024
40 checks passed
@goatgoose goatgoose deleted the connector-builder branch December 16, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants