You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: connect EPERM when connecting to https server with self signed certificate #20019
When connecting to https url with self signed certificate, the following error is thrown:
Error: connect EPERM /
at Object._errnoException (util.js:1019:11)
at _exceptionWithHostPort (util.js:1041:20)
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1175:14)
The issue isn't system independent and happens starting with nodev8.6.0. The code below works fine on nodev8.5.0 or lower on same machine
I don't see commits between v8.5.0 and v8.6.0 that are plausible candidates for such a regression. Are you sure v8.6.0 is the first release where this started happening for you?
Activity
apapirovski commentedon Apr 14, 2018
I think this might be a duplicate of #16196?
bamanuel commentedon Apr 15, 2018
It's very likely a duplicate of that issue, although I'm not 100% certain. The target server I was testing with only supports the following ciphers:
bnoordhuis commentedon Apr 15, 2018
Can you connect with
openssl s_client? What does it print?bamanuel commentedon Apr 15, 2018
Output from
openssl s_client(without the cert):bnoordhuis commentedon Apr 15, 2018
Okay, and what happens when you pass in the certificate with
-CAfile?bamanuel commentedon Apr 15, 2018
bnoordhuis commentedon Apr 16, 2018
That's progress. :-). What happens when you do this?
What when you add this?
bamanuel commentedon Apr 16, 2018
Same issue for both casesError: connect EPERM /Both of them work when i remove the following lines. See initial ticket comment.
bnoordhuis commentedon Apr 17, 2018
I don't see commits between v8.5.0 and v8.6.0 that are plausible candidates for such a regression. Are you sure v8.6.0 is the first release where this started happening for you?
bamanuel commentedon Apr 17, 2018
Yes, issue started with v8.6.0. The exactly line causing the issue is:
globalAgent.options = {ca: [fs.readFileSync('./caTrust.cer')]};Overwriting the entire globalAgent.options property (initially equals {path: null}) is causing the problem. Either of the following lines work:
richardlau commentedon Apr 17, 2018
Maybe due to #14564?
bnoordhuis commentedon Apr 18, 2018
I saw that commit but I didn't see anything obviously wrong in the diff.
@bamanuel Have you checked what happens when you revert commit ee157e5? Worth a try.
bamanuel commentedon Apr 19, 2018
It works after reverting ee157e5. I'm going to close this since options object shouldn't have been overwritten in the first place.
Thanks for help.
bnoordhuis commentedon Apr 19, 2018
cc @bengl since I doubt that's the intended behavior.