Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download fails behind corporate proxy #54

Open
frankenpfalzer opened this issue Nov 16, 2023 · 2 comments
Open

Download fails behind corporate proxy #54

frankenpfalzer opened this issue Nov 16, 2023 · 2 comments

Comments

@frankenpfalzer
Copy link

frankenpfalzer commented Nov 16, 2023

After upgrading from 1.9.14 to 1.11.1 the download of the princexml package fails with following exception:

.../[email protected]/node_modules/prince install$ node ./prince-npm.js install
.../[email protected]/node_modules/prince install: ++ checking for globally installed PrinceXML
.../[email protected]/node_modules/prince install: ++ downloading PrinceXML distribution
.../[email protected]/node_modules/prince install: -- using proxy ($http_proxy): http://www.example.com:80
.../[email protected]/node_modules/prince install: -- download: https://www.princexml.com/download/prince-15.2-alpine3.17-x86_64.tar.gz
.../[email protected]/node_modules/prince install: (node:507) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
.../[email protected]/node_modules/prince install: (Use `node --trace-warnings ...` to show where the warning was created)
.../[email protected]/node_modules/prince install: ** ERROR: failed to download: download failed: Error: connect ECONNREFUSED ::1:443
.../[email protected]/node_modules/prince install: Done

We also tried to set the proxy configuration via npm config set proxy "http://www.example.com:80". https-proxy and noproxy were set too.

Upgrading to 1.10.0 produces the same exception.

Our used environment:

  • nodejs: 20.9.0
  • pnpm: 8.10.5
  • OS: containerimage based on node:lts-alpine3.17

If you need any further information please let me know.

@rse
Copy link
Owner

rse commented Nov 17, 2023

That's not an issue with "prince", but an issue with Node itself. See the line:

node:507) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

Node cannot verify the SSL/TLS connection. The workaround is also given (setting the environment variable!).

@frankenpfalzer
Copy link
Author

frankenpfalzer commented Nov 20, 2023

The environment variable was already set (Btw. which was the reason for the warning). Even unsetting does not change the exception. After googleing a while, it seems that axios has sometimes several problems with corporate proxies. That would match to our case. After switching from request to axios the download does not work anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants