ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
190 stars 151 forks source link

Added support for npm config SSL CA-files for driverInstall.js #857

Closed patrick-lindemann closed 2 years ago

patrick-lindemann commented 2 years ago

This commit contains a solution that fixes #856.

The updated driverInstaller.js retreives the value for the cafile option from the npm config (if it was specified), reads the content of the file and passes a httpsAgent with the according ca value.

The installation of the DB2 ODBC drivers through npm run install was tested successfully behind a company proxy with a certificate signed by a custom Root CA.

If the cafile option is not defined in the config, the variable httpsAgent passed to axios will be undefined. This is also a valid option for axios, as it is the default value for this parameter.