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

feat(fetch): TLS client certificates (mutual authentication) for fetch() #11721

Merged
merged 11 commits into from
Aug 25, 2021
Merged

feat(fetch): TLS client certificates (mutual authentication) for fetch() #11721

merged 11 commits into from
Aug 25, 2021

Conversation

cryptographix
Copy link
Contributor

Implementation of TLS client-certificate for fetch(), largely based on work by @eric in #9426 - so all kudos to him for the hard work.

Needs patching to put feature behind the --unstable flag, see ext/fetch/lib.rs:547 for commented (incorrect) code

Implements #10516.

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

Is updating the test_util/wpt submodule intentional?

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

@seanwykes Thanks for the PR. Deno.createHttpClient is already unstable, so there doesn't need to be any additional checks for certChain and privateKey.

ext/tls/lib.rs Outdated Show resolved Hide resolved
@cryptographix
Copy link
Contributor Author

cryptographix commented Aug 16, 2021

Is updating the test_util/wpt submodule intentional?

@littledivy no, it's a mistake. Eliminated from PR.

@lucacasonato lucacasonato added this to the 1.14.0 milestone Aug 16, 2021
@lucacasonato lucacasonato self-requested a review August 16, 2021 16:10
ext/tls/lib.rs Outdated
@@ -156,6 +162,52 @@ pub fn create_client_config(
Ok(tls_config)
}

fn load_certs(reader: &mut dyn BufRead) -> Result<Vec<Certificate>, AnyError> {
Copy link
Member

Choose a reason for hiding this comment

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

These functions are all copied over from ext/net. Can you export them in ext/tls and remove them from ext/net (instead importing from ext/tls)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, can do! Should I bump tls version (0.1.1 -> 0.1.2) and update net's dependency on tls?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, not necessary (but thanks!). We'll do the releasing + publishing just before the next release, during the release process :-)

Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot @seanwykes, great feature to have.

@cryptographix
Copy link
Contributor Author

@lucacasonato thanks for the help and suggestions. And of course, thanks to @eric who did the real work in getting TLS client-certificates in.
It's been an interesting experience contributing to deno, and constantly switching between ts and rs.
Great project, guys!

@wesleyakio
Copy link

@cryptographix @lucacasonato what would be the path to land this on stable? (#10516 )

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.

None yet

5 participants