-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Proposed extension to https.request to allow using a custom OpenSSL client certificate engine. #6145
Comments
Providing glue for
I would suggest adding a new option to There is a gotcha: |
Got it!... so the https.js file needs to add the options.clientCertEngine value in getName(). And createSecureContext in _tls_common.js needs to add the clientCertEngine option and call some function on the context which should be implemented in node_crypto.cc (something like void SecureContext::SetClientCertEngine). I am totally new to Node contributing - what to do next to realize this? Thanks. |
You can find the steps in https://github.com/nodejs/node/blob/master/CONTRIBUTING.md - in a nutshell, make changes, add tests, run |
I have been looking into this a bit... I cannot find another test which actually builds something on the side (I would need to build a test engine as a .so/.dll file). I didn't see a test for crypto.setEngine either? |
You can probably jury-rig a new test in test/addons, one with two targets in its binding.gyp - one for the add-on and one for building the shared object ( And yes, I'm Dutch. =) |
Ok so I am almost there. Did the changes, created a test in addons which builds a .so test engine and some js to test it. However I am not able to build a dll on windows - it builds a .exp and a .lib file. Suggestions for a way forward? Thought the name sounded Dutch :-) My gf is Dutch but living with me in Denmark - we are going for King's day of course though! |
I probably also need some 'if (common.isWindows)' in my test to use .dll as extension rather than .so. Alternatively load by name instead of absolute .so path and set the openssl load path environment var - however that has platform specific conventions so on linux I would need to create the file as "libtestengine.so" and "testengine.dll" on windows. I actually tried that but first of all setting 'target_name': 'libtestengine' did not do what I would expect - and at the end of the day that would have to switch on platform. Unless the build system would take care of these differences in conventions? |
I was not getting a DLL because of build errors that I did not spot. |
Should be convenient if I could choose that openssl should be built as a static library while building my engine as a shared library. |
You shouldn't need to build openssl yourself; node re-exports its symbols. The headers should automatically get picked up when you build the add-on, node-gyp knows where to look for them. I filed #6274 so we have a weathervane for knowing that linking to openssl still works. Let's see how well it works on the Windows buildbots. EDIT: I'm going to back-peddle on the headers statement; I suspect that only works with release tarballs. |
So the initial way of just adding the openssl include path should have been ok? (given that the addon test-engine presumably links with node?). But that did not work on Windows. My fingers are crossed for you finding a solution! |
This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that. And, of course, a pull request implementing the feature would be welcome. |
Seems it was never back-linked but there is an (unfortunately stalled) pull request here: #6569 |
Can you share changes you made in _tls_common.js to specify loading your .so engine ? |
I am lacking a way to access the SSL_CTX_set_client_cert_engine function in OpenSSL when doing https requests. I think this functionality would be useful to others which is why I am posting here as a feature request?
Perhaps the interface could look something like this:
It shouldn't be a big thing to incorporate - I can provide a patch if needed? Obviously there would need to be some kind of consensus on the extension... is "clientCertEngine" the right name for instance?
Thanks in advance for the consideration!
The text was updated successfully, but these errors were encountered: