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

self-signed certificate #128

Closed
albert361 opened this issue Jun 8, 2023 · 6 comments · May be fixed by #135
Closed

self-signed certificate #128

albert361 opened this issue Jun 8, 2023 · 6 comments · May be fixed by #135

Comments

@albert361
Copy link

Hi,

Thanks for developing this plugin!
Is there a way to bypass self-signed certificate error?

npm notice Publishing to https://xxxxxxxxxxx/
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://xxxxxxxxxxx/@my-org%2fmy-package failed, reason: self-signed certificate in certificate chain
@mpetuska
Copy link
Owner

mpetuska commented Jun 8, 2023

I'm not sure. How's that normally handled with vanilla npm?

@albert361
Copy link
Author

albert361 commented Jun 8, 2023

Typically, we can use either:

  1. npm config set strict-ssl false -> not good since it updates global .npmrc
  2. npm config set cafile /path/to/cert.pem -> not good since it updates global .npmrc
  3. NODE_TLS_REJECT_UNAUTHORIZED=0 npm publish .....
  4. npm publish --strict-ssl false .....
    IMO we should at least have ability to use either 3 or 4 to let user temporary disable strict-ssl check ONLY for publishing.
    Regarding point 1 and 2, if update global .npmrc is Okay, then it should be configured already.

@mpetuska
Copy link
Owner

mpetuska commented Jun 9, 2023

Gotcha. Opt 4 is definitely something I could add to the plugin, but for now I think you can use opt 3 by passing that env var to gradle

e.g. NODE_TLS_REJECT_UNAUTHORIZED=0 ./gradlew publish

@mpetuska
Copy link
Owner

@albert361 can you share where that --strict-ssl option is documented? There's no mention of it in npm publish cli command docs

mpetuska added a commit that referenced this issue Jul 14, 2023
@mpetuska mpetuska linked a pull request Jul 14, 2023 that will close this issue
@mpetuska
Copy link
Owner

@albert361 any comments or should I close this for now?

@mpetuska
Copy link
Owner

Closing tgis for now until someone can provide some npm documentation for this.

@mpetuska mpetuska closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2023
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

Successfully merging a pull request may close this issue.

2 participants