Add Self-Signed SSL Cert To cURL

Self-Signed SSLIn an earlier post we talked about adding a self-signed SSL certificate to Google Chrome so that you can use SSL certificates on your local development machine. This solves the problem of browsing around on your local site, but it doesn’t solve the issue of making cURL calls. For example, if your site is running BackyBuddy or anything else that involves making backend calls over SSL, you will need to add / trust your self-signed certificate for cURL. So, here’s how you do it.

On Ubuntu, all the SSL certificates are hanging out together in /usr/share/ca-certificates If you followed my other article about adding a self-signed certificate to nginx, then your self-signed certificate is in /etc/ssl/your-certificate.crt

So symlink your self-signed certificate into /usr/share/ca-certificates like this:

Next, edit the file /etc/ca-certificates.conf by adding the name of your self-signed certificate to the list. Your file will end up looking something like this:

Now you just need to update your certificates with this command:

Now you should be able to successful use cURL on your local site over SSL. You can test it out like this:

 

One thought on “Add Self-Signed SSL Cert To cURL

  1. Thank you, that worked great for me.

Leave a Reply

Your email address will not be published. Required fields are marked *