have you ever generated your ssl csr (certificate signing request) request on a windows box and needed to install it on linux afterwards?
first, you have to get the certificate and private key out of windows,preferably in a pfx (pkcs #12) format.
once the pfx makes it over to the linux server, you have to decrypt the pfx into a plaintext pem file (pfx’s are binary files, and can’t be viewed in a text editor):
openssl pkcs12 -in certificate.pfx -out temp.pem
you will be asked for the password for the pfx (which is the one you set in the windows wizard). once you enter that, you will be asked for a new password. this new password is used to encrypt the private key. you cannot proceed until you enter a password that is 4 characters or longer. remember this password!
when this step is complete, you should have a pem file that you can read in a text editor. open the file in a text editor and copy the private key and certificate to different files (private.key certificate.crt respectively). remember to keep the dashed lines intact when you copy the certificates – this is important. there is some additional text above the key, and also between the key and certificate – this text should be ignored and should not be included in the certificate and key files.
now that you have the key and certificate separated, you need to decrypt the private key (or face the wrath of webserver software every time you start it). you can decrypt the private key like this:
openssl rsa -in private.key -out private.key
provide the same file name twice and it will decrypt the key onto itself, keeping everything in one file. openssl will ask for a password to decrypt the key, and this is the password you set when you decrypted the pfx. if you forgot the password, you will need to start over from when you brought it over from the windows machine.
after this process, you should have four files, a pfx, pem, key, and crt. store away the pfx and pem, and you will use the key and certificate files to install into apache or whatever software you’re configuring to use ssl.
sslengine on sslcertificatefile /path/to/your/certificate.crt sslcertificatekeyfile /path/to/your/private.key
ssl on; ssl_certificate_key /path/to/private.key; ssl_certificate /path/to/certificate.crt;
when you're a little too careless about virtualizing your domain controllers, cloning, migrating, backing up and restoring, returning from vacation… Read More
systemd is new service manager for linux. it's a replacement for all previous init systems (sysv/sysvinit & ubuntu's upstart) and… Read More