How to convert a pkcs12 certs to .pem certs for Aspera Shares

Shares NginX certificate files are defined in /opt/aspera/shares/etc/nginx/nginx.conf via the following configuration directives:

    ssl                       on;
    ssl_certificate           cert.pem;
    ssl_certificate_key       cert.key;

Convert the existing .crt file (in this case, mysite.crt and mysite.key) to .pem like so:

openssl pkcs12 -export -in mysite.crt -inkey mysite.key -out mysite.p12
openssl pkcs12 -in mysite.p12 -nodes -out mysite.pem

Stop the web service first:

/etc/init.d/aspera-shares stop

Change the certificate files:

cd /opt/aspera/shares/etc/nginx/
mv cert.pem old.cert.pem
mv cert.key old.cert.key
mv mysite.pem cert.pem
mv mysite.key cert.key

Start the NginX service:

/etc/init.d/aspera-shares start


Powered by Zendesk