Create a certificate for website in pkc12 format. Combine the intermediate and the certificate and private key.

Create Key file
openssl genrsa -des3 -out mg.key 2048

Create CSR with above keyfile
openssl req -new -sha256 -key ./cert.key -out ./cert.csr

Fill in the questions regarding the csr
Send the CSR to the company that issue certificates
When you get the certificate back from the cert company you do this

Create a all.crt file with cert,intermediate,root certificate

cert
intermediate
root cert

—–BEGIN CERTIFICATE—–
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
MQswCQYDVQQGEwJVUzEVMBMGA…….
—–END CERTIFICATE—–
—–BEGIN CERTIFICATE—–
MIIEsTCCA5mgAwIBAgIQBOHnpNxc8vNtwCtCuF0VnzANBgkqhkiG9w0BAQsFADBs
MQswCQYDVQQGEwJVUzEVMBMGA1UE…..
—–END CERTIFICATMIIG7zCCBdegAwIBAgIQDUbTtguiVpI11tAAw4bOKjANBgkqhkiG9w0BAQsFADBw……
—–END CERTIFICATE—–

Now we have a crt file with the certifcate and full chain.

Create PKCS12 with the private key
openssl pkcs12 -export -out onegate.p12 -inkey onegate.key -in all.crt
enter password and export password

Verify the p12 certificate
openssl pkcs12 -info -in onegate.p12

Done!

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.