Skip to content

Use extension trait to simplify config#150

Merged
djc merged 1 commit into
mainfrom
extension-trait
Oct 28, 2024
Merged

Use extension trait to simplify config#150
djc merged 1 commit into
mainfrom
extension-trait

Conversation

@djc

@djc djc commented Oct 25, 2024

Copy link
Copy Markdown
Member

No description provided.

@ctz ctz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like a big improvement!

Comment thread rustls-platform-verifier/src/lib.rs Outdated
@djc

djc commented Oct 25, 2024

Copy link
Copy Markdown
Member Author

Another idea: we could potentially add another trait implemented directly for ClientConfig, such that you could do ClientConfig::with_platform_verifier() and ClientConfig::with_platform_verifier_and_provider(provider).

Worth doing over the current approach of rustls_platform_verifier::tls_config()?

@djc djc force-pushed the extension-trait branch from f920d46 to 6e6d73a Compare October 25, 2024 09:43

@cpu cpu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@cpu

cpu commented Oct 25, 2024

Copy link
Copy Markdown
Member

Worth doing over the current approach of rustls_platform_verifier::tls_config()?

Your proposal seems a bit tidier to me. I'd be 👍

@complexspaces

complexspaces commented Oct 25, 2024

Copy link
Copy Markdown
Collaborator

If we don't remove tls_config, maybe we should reimplement it in terms of the new extension trait internally for better coverage? Otherwise I think this looks fine.

@complexspaces complexspaces mentioned this pull request Oct 26, 2024
4 tasks
@djc djc force-pushed the extension-trait branch from 6e6d73a to dfd00a8 Compare October 27, 2024 20:15
@djc

djc commented Oct 27, 2024

Copy link
Copy Markdown
Member Author

Implemented a "maximalist" approach with two new traits, that deprecates the old tls_config*() API.

@djc djc force-pushed the extension-trait branch 3 times, most recently from ae9b31d to c8bfc6f Compare October 27, 2024 20:24
Comment thread rustls-platform-verifier/src/lib.rs
@djc djc force-pushed the extension-trait branch from c8bfc6f to de7ce46 Compare October 28, 2024 13:27
@djc

djc commented Oct 28, 2024

Copy link
Copy Markdown
Member Author

Updated the README and also used the new ConfigBuilder::crypto_provider() API to make sure we use the matching crypto provider.

@djc djc force-pushed the extension-trait branch from de7ce46 to dde835b Compare October 28, 2024 13:33
@djc djc merged commit 08d5fd9 into main Oct 28, 2024
@cpu cpu deleted the extension-trait branch October 30, 2024 19:54
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.

4 participants