Skip to content

fix certificate (zip) download for newer npm installations #20

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

popy2k14
Copy link

certificate download failed on my instance until i relaized the api changed.
Maybe a fallback to the old one would be nice.
That is currently not implemented!

popy2k14 added 2 commits June 29, 2025 20:40
certificate download failed on my instance
fix certificate (zip) download for newer npm installations
@Erreur32
Copy link
Owner

Erreur32 commented Jul 3, 2025

Thank you @popy2k14 for your contribution !
I will review and test your changes shortly before merging. I’ll keep you updated if anything needs to be adjusted.

@Erreur32 Erreur32 self-assigned this Jul 3, 2025
@popy2k14
Copy link
Author

popy2k14 commented Jul 3, 2025

@Erreur32
Youre welcome :-)

I have made a mistake on the PR:

this:

CERT_FILE=$(ls "$TMP_UNZIP_DIR"/cert8.pem 2>/dev/null) CHAIN_FILE=$(ls "$TMP_UNZIP_DIR"/chain8.pem 2>/dev/null) FULLCHAIN_FILE=$(ls "$TMP_UNZIP_DIR"/fullchain8.pem 2>/dev/null) PRIVKEY_FILE=$(ls "$TMP_UNZIP_DIR"/privkey8.pem 2>/dev/null)

has to be this:

CERT_FILE=$(ls "$TMP_UNZIP_DIR"/cert*.pem 2>/dev/null) CHAIN_FILE=$(ls "$TMP_UNZIP_DIR"/chain*.pem 2>/dev/null) FULLCHAIN_FILE=$(ls "$TMP_UNZIP_DIR"/fullchain*.pem 2>/dev/null) PRIVKEY_FILE=$(ls "$TMP_UNZIP_DIR"/privkey*.pem 2>/dev/null)

I have recognized this later and not update the PR.
Reason for this is that NPM increases the number when the cert is renewed.
Please change this before merging (if needed, i can change my PR, but sadly not much time currently).

Another thing is that i think you should leave the old download code in place, when "null" is in the downloaded conent, then use the new approach. This way we support older and newer npm versions.

Or check some npm api version? (if somthing exists).

Just let me know if you need help.

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 this pull request may close these issues.

2 participants