Skip to content

Generate .P12 files #4658

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 3 commits into
base: develop
Choose a base branch
from

Conversation

Whatchawnt
Copy link

As an Enhancement the script would generate a P12 file.
The script takes to possible arguments the generated P12 file is created based on the files in the associated "npm-#" folders already generated by nginx-proxy-manager. This is only a bash script but if someone generates the front end for this script, it can be used to generate the P12 files by passing in the arguments from the front end.

`Options:
--npm Required. Name or identifier used for the certificate. Must be in the form 'npm-#'
--password Optional. Password to secure the PKCS#12 (.p12) file. If not provided the scipt will use the script default.
-h, --help Show this help message and exit.

Example:
./$SCRIPT_NAME --npm npm-123
./$SCRIPT_NAME --npm npm-123 --password secret123`

Original Enhancement Request: #4599

1. Added ability to generate .p12 file (fullPKCS12.p12) from the certificates, private keys, and certificate chain. The script downloads the root certificate from the copy of the intermediate certificate.
2. Added simlink for /etc/letsencrypt/live/npm-10/fullpkcs12.sh to  /etc/letsencrypt/live/npm-10/fullpkcs12-#.sh (Where -# is the number appended based on the number that comes after the private key in the same directory, so if privkey1.pem is in the folder then the script will generate fullpkcs12-1.sh)

Still Yet To do:
1. Add ability for changing "npm-10" by taking in an argument by the script.
1. Added Option to parse in the npm value (I.E. npm-10)  as a required variable which is the npm value that the certificate files are stored in (I.E. '/etc/letsencrypt/live/npm-10/'   and   '/etc/letsencrypt/archive/npm-10/' )
2. Added the option to parse a password into the script to be used as the p12 password for securing the private key within the generated PKCS12 file.
3. Added Variable in script to allow the user to keep the root certificate that the script generates ($KEEP_ROOT_CERTIFICATE which it is set to true by default).
4. Added Simlinks for the .p12 file (follows the current convention)
5. Added Simlink for the root certificate, if the user chooses to keep the root certificate by setting the variable $KEEP_ROOT_CERTIFICATE to true (follows the current convention)
4. Added automatic cleanup for temporary files as well as the root file when the variable $KEEP_ROOT_CERTIFICATE is set to false.
1. Added Option to parse in the npm value (I.E. npm-10)  as a required variable which is the npm value that the certificate files are stored in (I.E. '/etc/letsencrypt/live/npm-10/'   and   '/etc/letsencrypt/archive/npm-10/' )
2. Added the option to parse a password into the script to be used as the p12 password for securing the private key within the generated PKCS12 file.
3. Added Variable in script to allow the user to keep the root certificate that the script generates ($KEEP_ROOT_CERTIFICATE which it is set to true by default).
4. Added Simlinks for the .p12 file (follows the current convention)
5. Added Simlink for the root certificate, if the user chooses to keep the root certificate by setting the variable $KEEP_ROOT_CERTIFICATE to true (follows the current convention)
6. Added automatic cleanup for temporary files as well as the root file when the variable $KEEP_ROOT_CERTIFICATE is set to false.
7. Changed Print Help Text to use echo command.
@nginxproxymanagerci
Copy link

Docker Image for build 1 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-4658

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

@Whatchawnt
Copy link
Author

This script should be run after a certificate generation or after rekey of certificates to keep the .p12 current.

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.

1 participant