Skip to content

Instantly share code, notes, and snippets.

@arnau
Created July 6, 2015 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnau/50e0dd3bb02d07e19f47 to your computer and use it in GitHub Desktop.
Save arnau/50e0dd3bb02d07e19f47 to your computer and use it in GitHub Desktop.
curl on MacOSX is not able to use TLS via pem
#
# When in MacOSX, running:
curl --cacert ca.pem --cert cert.pem --key key.pem https://192.168.99.100:2375
# Fails with:
# curl: (58) SSL: Can't load the certificate "/Users/arnau/.docker/machine/machines/dev/cert.pem" and its private key: OSStatus -25299
#
# This is explained here: https://github.com/bagder/curl/issues/283#issuecomment-104070069
#
# In short, MacOSX does not allow curl to use pem in this case. A P12 must be used instead.
openssl pkcs12 -export -out cert.pfx -inkey key.pem -in cert.pem -certfile ca.pem
curl --cert cert.pfx:mypassword https://192.168.99.100:2375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment