Skip to content

Instantly share code, notes, and snippets.

View ollemg's full-sized avatar
🍫
Focusing

Gabriel de Mello Barbosa ollemg

🍫
Focusing
View GitHub Profile
@ollemg
ollemg / server_certificates_to_pem.md
Created December 21, 2021 23:05 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@ollemg
ollemg / cloudSettings
Last active October 15, 2020 14:39
VScode Sync
{"lastUpload":"2020-10-15T14:39:50.004Z","extensionVersion":"v3.4.3"}
@ollemg
ollemg / keybase
Last active June 17, 2019 01:40
Keybase
### Keybase proof
I hereby claim:
* I am ollemg on github.
* I am ollemg (https://keybase.io/ollemg) on keybase.
* I have a public key ASAhveJY9viil9X7c_jkhDPfU3v4WGOi6-hTe2rcC_2rLwo