Header Ads

Convert .pfx file to .crt, .key, .rsa for nginx

Convert .pfx file to .crt, .key, .rsa for nginx


How to convert .pfx file to crt, .key, .rsa for nginx?

How to convert .pfx file to crt, .key, .rsa for nginx?

Convert .pem to .pfx

Open terminal on Ubuntu:


openssl pkcs12 -in filename.pfx -clcerts -nokeys -out filename.crt

openssl pkcs12 -in filename.pfx -nocerts -out filename.key

openssl rsa -in filename.key -out filename.rsa


sudo apt-get install putty-tools

sudo puttygen pemKey.pem -o ppkKey.ppk -O private

sudo puttygen ppkkey.ppk -O private-openssh -o pemkey.pem

 Nginx Config:


server {
        listen                  443 ssl http2;
        server_name             magento.local;
        set $MAGE_ROOT          /var/www/magento;
        set $MAGE_MODE          developer;
        include                 /var/www/magento/nginx.conf.sample;

        ssl_certificate         /var/www/ssl/filename.crt;
        ssl_certificate_key     /var/www/ssl/filename.rsa;
        ssl_protocols           TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers             HIGH:!aNULL:!MD5;

        error_log /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;
}

No comments