-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Add support for webpki roots #107
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9803568
Add support for native tls certificates
ospfranco 2d63e77
Also patch processor builder
ospfranco bb2239d
Create a https_connector file that abstracts the creation of the conn…
ospfranco 3628234
Add missing comment for other function
ospfranco cf2bb70
Allow for http or https
ospfranco 6c15037
Fix non-native-certs imports
ospfranco d75107d
Change flag to use webpki-roots
ospfranco d9faa84
Update comments
ospfranco b69f964
Remove unused dependency
keelerm84 39fa1c9
Remove public export
keelerm84 13f6b32
Unify create_https_connector; separate builder step
keelerm84 e5d9953
Expand tests
keelerm84 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've not added the custom cert capability for rust contract tests, right? Not that we need to right now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| **/*.rs.bk | ||
| Cargo.lock | ||
| .idea | ||
| .vscode | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Needs another blank line. |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| use hyper::client::HttpConnector; | ||
| use hyper_rustls::builderstates::WantsSchemes; | ||
| use hyper_rustls::HttpsConnector; | ||
| use hyper_rustls::HttpsConnectorBuilder; | ||
|
|
||
| // Creates an HTTPS connector for secure HTTP requests. | ||
| // | ||
| // This function configures and returns a connector that provides HTTPS capabilities to | ||
| // HTTP client implementations. | ||
| // | ||
| // # Features | ||
| // | ||
| // By default, this function uses the system's native certificate store for certificate | ||
| // verification. However, if the `webpki-roots` feature is enabled, it will use the | ||
| // WebPKI library instead. This is useful in environments where the system's certificate | ||
| // store is not available or not reliable. | ||
| // | ||
| pub fn create_https_connector() -> HttpsConnector<HttpConnector> { | ||
| builder() | ||
| .https_or_http() | ||
| .enable_http1() | ||
| .enable_http2() | ||
| .build() | ||
| } | ||
|
|
||
| #[cfg(feature = "webpki-roots")] | ||
| fn builder() -> HttpsConnectorBuilder<WantsSchemes> { | ||
| HttpsConnectorBuilder::new().with_webpki_roots() | ||
| } | ||
|
|
||
| #[cfg(not(feature = "webpki-roots"))] | ||
| fn builder() -> HttpsConnectorBuilder<WantsSchemes> { | ||
| HttpsConnectorBuilder::new().with_native_roots() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to have an example string in the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or in a comment.