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
We are trying to build node 18 off of your docker image. we are using a custom alpine:3.17 base image that installs openssl 3.0.8 and enables fips. We are running into an issue with the variable NODE_EXTRA_CA_CERTS that returns the error
I am having trouble finding any relevant information on the error nor that variable. My main question is "is node18 compatible with openssl 3.0.8? I see here that it is compatible and fips capable with openssl 3.0.0
One other question if you know would be where that variable would store the cert in the container? NODE_EXTRA_CA_CERTS
Node.js version
18.16.0
Example code
I can paste the dockerfiles if you would like.
docker run -e NODE_EXTRA_CA_CERTS=cert.pem nodejs18-slim:test1
[[AWarning: Ignoring extra certs from `cert.pem`, load failed: error:80000002:system library::No such file or directory
Runtime error that i think might be cause by our base image. Not a developer so am unfamiliar with node. I have googled this extensively but am lost at this point. Our image works fine thus far except for then trying to pass in new certs.
@coltonfreeman26 How do you enable FIPS? If you load the FIPS provider through a custom OpenSSL configuration file (or if you use a system OpenSSL configuration file that enables FIPS) you may need to explicitly enable a random-number generator implementation. CSPRNG() may fail if no random-number generator implementation has been enabled.
As NODE_EXTRA_CA_CERTS is involved, this might be related to nodejs/node#48143. nodejs/node#48159 hasn't gone out in a release yet -- in needs to be released in Node.js 20 first before we consider it for Node.js 18.
@tniessen We are using the system openssl with alpine. fips is being inherited. i messed around with this a little bit and i seem to have success with this when i install node via apk. i am guessing this has something to do with how we are enabling fips on the host. i am not familiar with CSPRING but will need to dive into that more. i will also take a look into enabling a random number generator.
@preveen-stack i most certainly can. i will let you know if there is any luck there.
@richardlau thank you for those links. i will read through those and update if this looks like our issue.
if you know would be where that variable would store the cert in the container? NODE_EXTRA_CA_CERTS
@coltonfreeman26 it should be the path to the certs in the container. If cert.pem is a local file on the host system, you would need to copy it into the Dockerfile, and then provide the path relative to the container.
Host dir structure:
$ ls
Dockerfile
my_extra_cert.pem
Dockerfile needs to copy the cert into the container:
FROM node:18
# Relative to the container, the cert will be in /my_extra_cert.pem!COPY my_extra_cert.pem /my_extra_cert.pem
# Other dockerfile stuff...
Then run as:
docker run -e NODE_EXTRA_CA_CERTS=/my_extra_cert.pem nodejs18-slim:test1
NOTE THE VAR IS /my_extra_cert.pem! (Absolute path)
Btw, if you copy the cert into the container via the dockerfile, you can also specify the env variable in the dockerfile itself, e.g.:
FROM node:18
# Relative to the container, the cert will be in /my_extra_cert.pem!COPY my_extra_cert.pem /my_extra_cert.pem
# Other dockerfile stuff# Set the extra ca certs varENV NODE_EXTRA_CA_CERTS=/my_extra_cert.pem
Hmm, I thought the point of that NODE_EXTRA_CA_CERTS was so someone could add a cert at runtime. We are not wanting to copy in any specific cert at this time. We need this functionality so downstream users can add self signed certs. Mounting seems to work for this but am trying to figure out why we are unable to get this to work.
Right, if you mount you local directory into the container that could also work. As long as node in the container has a path relative to it , which it can read (e.g. mount host into docker container)
There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.
Activity
preveen-stack commentedon May 13, 2023
https://github.com/nodejs/node/blob/c5f46293abe434b536f8caf24031692cba47e4f4/src/node.cc#L1039-L1040
Looks like CSPRNG init fails
can you try
tniessen commentedon Jun 5, 2023
@coltonfreeman26 How do you enable FIPS? If you load the FIPS provider through a custom OpenSSL configuration file (or if you use a system OpenSSL configuration file that enables FIPS) you may need to explicitly enable a random-number generator implementation.
CSPRNG()may fail if no random-number generator implementation has been enabled.richardlau commentedon Jun 5, 2023
As
NODE_EXTRA_CA_CERTSis involved, this might be related to nodejs/node#48143. nodejs/node#48159 hasn't gone out in a release yet -- in needs to be released in Node.js 20 first before we consider it for Node.js 18.coltonfreeman26 commentedon Jun 5, 2023
@tniessen We are using the system openssl with alpine. fips is being inherited. i messed around with this a little bit and i seem to have success with this when i install node via apk. i am guessing this has something to do with how we are enabling fips on the host. i am not familiar with CSPRING but will need to dive into that more. i will also take a look into enabling a random number generator.
@preveen-stack i most certainly can. i will let you know if there is any luck there.
@richardlau thank you for those links. i will read through those and update if this looks like our issue.
thank you all for the feedback.
ckcr4lyf commentedon Jun 7, 2023
@coltonfreeman26 it should be the path to the certs in the container. If
cert.pemis a local file on the host system, you would need to copy it into the Dockerfile, and then provide the path relative to the container.Host dir structure:
Dockerfile needs to copy the cert into the container:
Then run as:
NOTE THE VAR IS
/my_extra_cert.pem! (Absolute path)ckcr4lyf commentedon Jun 7, 2023
Btw, if you copy the cert into the container via the dockerfile, you can also specify the env variable in the dockerfile itself, e.g.:
coltonfreeman26 commentedon Jun 7, 2023
Hmm, I thought the point of that NODE_EXTRA_CA_CERTS was so someone could add a cert at runtime. We are not wanting to copy in any specific cert at this time. We need this functionality so downstream users can add self signed certs. Mounting seems to work for this but am trying to figure out why we are unable to get this to work.
ckcr4lyf commentedon Jun 7, 2023
Right, if you mount you local directory into the container that could also work. As long as node in the container has a path relative to it , which it can read (e.g. mount host into docker container)
github-actions commentedon May 3, 2024
There has been no activity on this issue for 11 months. The help repository works best when sustained engagement moves conversation forward. The issue will be closed in 1 month. If you are still experiencing this issue on the latest supported versions of Node.js, please leave a comment.
github-actions commentedon Jun 3, 2024
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.