JuliaLang / MbedTLS.jl

Wrapper around mbedtls
Other
41 stars 50 forks source link

Cannot create SSLConfig from a single pfx file #231

Open sairus7 opened 3 years ago

sairus7 commented 3 years ago

Seems like SSLConfig only accepts .cert and .key files, but does not accept a single pfx cert file with a key in it.

fchorney commented 2 years ago

I came across a similar issue, and solved it by making cert and key files out of a pfx cert.

PFX="/path/to/file.pfx"
PASSWORD="PFX_PASSWORD"

openssl pkcs12 -in $PFX -nocerts -nodes -password pass:$PASSWORD -out cert-key.pem
openssl pkcs12 -in $PFX -nokeys -nodes -clcerts -password pass:$PASSWORD -out cert.pem
openssl rsa -in cert-key.pem -out key.pem

From there you can use cert.pem and key.pem to create an SSLConfig object