Skip to content

Conversation

djc
Copy link
Owner

@djc djc commented Jul 4, 2025

Fixes #127.

cc @the-wondersmith what do you think? Does this adequately support your needs?

@djc djc requested a review from cpu July 4, 2025 11:56
@the-wondersmith
Copy link

@djc Dang! That was fast! 😅

I think that would almost 100% work. Would you be opposed to adding pub use ...'es for the necessary types to construct a valid ClientConfig? That way downstream users don't need to pull in the dependencies themselves, and the instant-acme dep is self-sufficient for most cases.

#[cfg(feature = "hyper-rustls")]
impl DefaultClient {
/// Create a new default HTTP client with the given TLS configuration
pub fn with_config(config: rustls::ClientConfig) -> Self {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does make rustls part of the public API, which is something I was trying to avoid before. Not sure about the trade-off here... @cpu thoughts?

I guess we're leaking crypto::Unspecified and crypto::KeyRejected in the Error type anyway so the additional rustls leakage might not matter much?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it feels like something that will be annoying in the future. I could swallow that speculative worry if the motivator was strong but in this case I'm not positive it is.

RFC 8555 §6.1 is unambiguous about HTTPS being REQUIRED. That's part of why Pebble's ACME interface isn't http:// despite being for local testing.

Is reading a CA PEM file and configuring a HyperClient really enough of a burden to want to fuse our release cycle w/ rustls? can we make that easier somehow instead?

Copy link
Owner Author

@djc djc Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make that easier somehow instead?

The original issue made a proposal which makes it easier (or at least doesn't require API leakage)... but historically we haven't wanted to facilitate skipping verification.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but historically we haven't wanted to facilitate skipping verification.

Right, I mean make it easier to load the server's non-standard trust anchor so we're doing HTTPS + validating the presented cert chain.

Copy link
Collaborator

@cpu cpu Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this: #131 (some polish probably required)

I think with a bit of refactoring we could switch the Pebble tests to using that as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we're leaking crypto::Unspecified and crypto::KeyRejected in the Error type anyway so the additional rustls leakage might not matter much?

yeah 😓 Here's a first step towards wrangling that: #130

@djc
Copy link
Owner Author

djc commented Jul 4, 2025

I think that would almost 100% work. Would you be opposed to adding pub use ...'es for the necessary types to construct a valid ClientConfig? That way downstream users don't need to pull in the dependencies themselves, and the instant-acme dep is self-sufficient for most cases.

I don't think I want to re-export rustls::client::danger::ServerCertVerifier.

@the-wondersmith
Copy link

{ ... }

I don't think I want to re-export rustls::client::danger::ServerCertVerifier.

Yeah, that's fair. Screw it, I think what you've got there is more than generous. I say ship it 😂

@djc
Copy link
Owner Author

djc commented Jul 7, 2025

Closing in favor of #131.

@djc djc closed this Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opt-In "Insecure No Verify" Client Mode
3 participants