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

Add client certificates support #23

Open
teabroker opened this issue Oct 11, 2023 · 2 comments
Open

Add client certificates support #23

teabroker opened this issue Oct 11, 2023 · 2 comments

Comments

@teabroker
Copy link

teabroker commented Oct 11, 2023

There should be an ability to add client certificates to the new TLS connection. While this feature is implemented in web clients on the browser side (and not allowed from the code side), it's important to have ability to specify client certificates from code on the server side.

Some apps use client certificates as an authentication technology, so it might be critical.

It could look like an option properties tlsKey, tlsCert or as an object property tls with key and cert properties:

const socket = connect('https://example.com', {
  tls: {
    key: clientKey,
    cert: clientCert,
  },
)

The key and certificate values could be WebCrypto API primitives or TypedArray, ArrayBuffer, DataView instances.

@jasnell
Copy link
Collaborator

jasnell commented Nov 5, 2023

Definitely agree this is necessary. For a managed environment like workers the key and cert are more likely to be provided by an out-of-band binding configuration, but for unmanaged environments like Node.js, these will need to be provided via configuration options. Will definitely work to get these added.

@teabroker
Copy link
Author

teabroker commented Nov 11, 2023

It also should be possible to specify or to verify remote end certificate too. It is common API for Node.js and Electron, but not for other runtimes. And it has been requested in Deno (Issue #6170) and Bun (Issue #1044).

It seems like this feature is crucial. And the runtimes seem to have troubles to implement this without having a standard.

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

No branches or pull requests

2 participants