--ca-file options seems to be broken with Node >= 12 #33492
Labels
stale?
Issue that may be closed soon due to the original author not responding any more.
status: needs reproduction
This issue needs a simplified reproduction of the bug for further troubleshooting.
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
--ca-file is used to set
NODE_EXTRA_CA_CERTS
atgatsby/packages/gatsby/src/utils/get-ssl-cert.ts
Lines 65 to 67 in 934035d
But
NODE_EXTRA_CA_CERTS
must not be set at runtime: https://nodejs.org/api/cli.html#cli_node_extra_ca_certs_file (and it is loaded at startup since node 12, see nodejs/node#23354).
We don't know exactly why we had this regression (node upgrade, Gatsby 3 upgrade, ?) but socket.io URL (such as
.../8001/socket.io/?EIO=4&transport=polling
) was presenting wrong certificate, while regular server is Ok. Manually settingNODE_EXTRA_CA_CERTS
fix the issue.Reproduction Link
Steps to Reproduce
Set
--ca-file
optionExpected Result
No certificate error on
socket.io/?EIO=4&transport=polling
URLsActual Result
Certificate error on
socket.io/?EIO=4&transport=polling
URLsEnvironment
Config Flags
No response
The text was updated successfully, but these errors were encountered: