NodeJS fail / UNABLE_TO_GET_ISSUER_CERT_LOCALLY

Do you want to: NodeJS fail / UNABLE_TO_GET_ISSUER_CERT_LOCALLY;connect:undefined Error: unable to get local issuer certificate
Document Server version: 9.0.3 (NodeJS 6.13)
Type of installation of the Document Server: deb/rpm
OS: Ubuntu 22.02
Browser version: FF/Chrome
Additional information:
Good morning,

I have the problem with the certificate verification by Node.js since the change from OnlyOffice 8.3 to 9.0.3.

Currently the verification in the default.json has been deactivated:
rejectUnauthorized": false

However, this should not be a permanent state, but should be reactivated. The root and the server certificate are located under /etc/ssl/cert and were also verified using openssl -verify.

There is an option to change or add Node.js to openssl in the systemd services:
sudo nano /lib/systemd/system/ds-docservice.service
sudo nano /lib/systemd/system/ds-converter.service
environment=NODE_ENV=production-linux NODE_OPTIONS=–use-openssl-ca …

Unfortunately this does not bring any improvement, the error message still appears.

Error message:
[ERROR] [localhost] [3980854427] [ocw5d89cjctv_USER] nodeJS - error downloadFile:url=https://URL
UNABLE_TO_GET_ISSUER_CERT_LOCALLY;connect:undefined Error: unable to get local issuer certificate

Would you have any tips on where I could start here with OnlyOffice or Node.js so that the verification works again?

Thank you very much

Hey @dropmen :wave:
Thanks for the details!

This issue is likely due to Node.js not recognizing your certificate chain. Here’s what you can try:

1. Create a custom CA bundle
Join your root and intermediate certs into one file.


2. Edit systemd service files
Open these files:

sudo nano /lib/systemd/system/ds-docservice.service  
sudo nano /lib/systemd/system/ds-converter.service  

Add this line under [Service] (use your actual path):

Environment="NODE_EXTRA_CA_CERTS=/etc/ssl/certs/custom-ca-bundle.crt"

3. Restart services

sudo systemctl restart ds-docservice ds-converter

Let us know how it goes!

1 Like

Perfect, that’s exactly what it was! Many thanks for the help! :partying_face: :partying_face:

1 Like