electron: [Bug]: Unable to verify leaf signature with TLS connection
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
v25.0.0
What operating system are you using?
Windows
Operating System Version
Windows 10 19045.2965
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Using a self-signed certificate to create a TLS connection with a custom CA when running Electron as NodeJS successfully performs the request without error.
Actual Behavior
The request fails with the following stacktrace:
Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket._finishInit (node:_tls_wrap:959:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12) {
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE
Testcase Gist URL
https://gist.github.com/kylecarbs/3eeb7d35a5fd6d9828e675f467144947
Additional Information
Reproduction:
- Run
server.jsin a background terminal - Run
node client.jsand observeWorking!being output. - Run
ELECTRON_RUN_AS_NODE=1 electron.exe client.jsand observe the error.
It’s possible I’m missing something obvious here. I’ve reproduced this on Linux and Windows.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (2 by maintainers)
I can confirm the findings mentioned in https://github.com/electron/electron/issues/38527#issuecomment-1626220389. Removing the
keyUsagewould solve the issue.@code-asher Thanks for investigating!
Is there any hope, that this bug will be solved?