#/etc/haproxy/certs/ssl-convert-PEM-2-PFX.sh
###################################################
#LastUpdate: #7:59 2022.02.18
###################################################
#__________[GLOBAL_VAR]:BEGIN
Domain_Name="example.com"
SSL_CRT_From_Provider="star_example.com.crt"
SSL_CA_From_Provider="DigiCertCA.crt"
SSL_CA_Bundle_Provider="My_CA_Bundle.crt"
SSL_CERT_PRIVATE="003-1-STAR_.example.com-PRIVATE.key"
SSL_CERT_PEM_FORMAT="$Domain_Name-wildcard-2021.10.03.pem"
#__________[GLOBAL_VAR]:END
openssl \
pkcs12 \
-inkey $SSL_CERT_PRIVATE \
-in $SSL_CRT_From_Provider \
-certfile $SSL_CA_Bundle_Provider \
-export -out $Domain_Name-wildcard-2021.10.03.pfx
echo "VERIFY SSL CERT:"
openssl pkcs12 -info -in $Domain_Name-wildcard-2021.10.03.pfx
#RESULT: example.com-wildcard-2021.10.03.pfx
REF:
1:
#https://www.sslshopper.com/ssl-converter.html
#Convert PEM to PFX:
#openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
2:
STEP BY STEP USING LETSENCRYPT TO MAKE SSL CERT FOR IIS - MANUAL