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

http2 - cannot use client certificate and key #15405

Closed
dragosnicolae opened this issue Sep 14, 2017 · 10 comments
Closed

http2 - cannot use client certificate and key #15405

dragosnicolae opened this issue Sep 14, 2017 · 10 comments
Labels
feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors. http2 Issues or PRs related to the http2 subsystem.

Comments

@dragosnicolae
Copy link

Version: 8.4.0

Currently, as a client, you cannot specify a certificate-key pair for authentication. I know that the http2 module is still experimental, but this seems like a useful feature.

@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Sep 14, 2017
@mcollina mcollina added feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors. labels Sep 14, 2017
@mcollina
Copy link
Member

Definitely. It should be simple to add, tagging as good-first-contribution.
@dragosnicolae do you want to send a PR with it?

@darahayes
Copy link

@mcollina I've been really wanting to make some contributions to the project. I would love to give this a shot if I could get some pointers for getting started. I've been reading through the http2/core.js file and I think it mostly looks like a few small changes are needed to propagate the appropriate options down into the connect function. Does that sound right?

@mcollina
Copy link
Member

@darahayes yes, definitely!

@apapirovski
Copy link
Contributor

apapirovski commented Sep 15, 2017

@mcollina am I missing something here? I thought this was taken care of by the underlying TLS module. I'm able to use requestCert: true just fine (and pass in the key & cert). This is probably a documentation issue rather than a feature that's missing.

@mcollina
Copy link
Member

@apapirovski I tend to agree (https://github.com/nodejs/node/blob/master/lib/internal/http2/core.js#L2434). However we don't have a test to cover this behavior, so we should probably add that test and updates the docs.

@darahayes
Copy link

I did some investigation into this issue and on a separate note I found that currently http2.createSecureServer server does not properly support the requestCert and ca arguments passed into the tls module for using client certificate authentication.

I had to reinstall my OS over the weekend so I will need to do some more work to reproduce but basically the connection is never fully established for some reason. The debug logs showed onhandshakestart being printed multiple times but the session is never established.

@mcollina Should I investigate this and open a proper issue?

@mcollina
Copy link
Member

@darahayes open a PR with the fix and unit tests.

@ryshep111
Copy link

I am merely a noob that happens to be at node.js interactive, but looking at the documentation here it does mention that any options supported by tls.createServer are available. One thing I noticed is that the 'ca' option is passed on tls.connect (via createSecureContext) and not createServer. If you omit this option, a self-signed cert will not work.

@nikshepsvn
Copy link

is this still open? would love to give it a shot if someone could guide me a little with where to look and what I need to accomplish :)

@mcollina
Copy link
Member

mcollina commented Oct 9, 2017

I think @davidmarkclements is working on it.

apapirovski added a commit to apapirovski/node that referenced this issue Oct 28, 2017
gibfahn pushed a commit that referenced this issue Oct 30, 2017
PR-URL: #16576
Fixes: #15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit that referenced this issue Oct 30, 2017
PR-URL: #16576
Fixes: #15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit that referenced this issue Oct 31, 2017
PR-URL: #16576
Fixes: #15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Qard pushed a commit to ayojs/ayo that referenced this issue Nov 2, 2017
PR-URL: nodejs/node#16576
Fixes: nodejs/node#15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Qard pushed a commit to ayojs/ayo that referenced this issue Nov 2, 2017
PR-URL: nodejs/node#16576
Fixes: nodejs/node#15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this issue Dec 7, 2017
PR-URL: nodejs/node#16576
Fixes: nodejs/node#15405
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. good first issue Issues that are suitable for first-time contributors. http2 Issues or PRs related to the http2 subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants