MyCA — DIY HTTPS Certificates

HTTPS is good for the web, but it means you need a certificate. You can get one from a commercial CA, but maybe that's too hard for your small project. So let's make our own certificates!

This page provides a simple set of tools to make certificates for web servers. You can make your own trusted root certificate, then use it to issue certificates for servers. Then all you need to do is configure your browser and servers with those certificates, and you're part of the secure web.

FAQ

Q. Who should use this?

A. The certificates you can make here require the user to agree to use them before they're considered secure. So they are best for sites with a small number of users, rather than a site that you intend to be visibile to the whole world. If you're experimenting with a new idea with a few friends, MyCA certificates should work fine. If you want to set up something bigger, you should probably get a certificate from a CA that the browsers will trust without requiring the user's consent. (There are several free options, and even more for a fee.)

Q. Am I exposing my private keys by using this site to make my certificates?

A. Through the magic of JavaScript, everything MyCA does is done on your computer, in your browser. MyCA never sees your private information, and will not be able to impersonate your CA or your servers. Plus, this whole thing is open source, so you can check that we're not lying.

Act I: Make a root certificate

  1. Name this root:
  2. Download the key and certificate

Quick check

openssl x509 -in root.cert.pem -text
openssl verify -CAfile root.cert.pem root.cert.pem

Act II: Make server certificate(s)

- you need to have a root certificate before you do this step

  1. Load your root:
    • Select key file:
    • Select certificate file:
  2. Enter names (whitespace-separated):

  3. Download the key and certificate

Quick check

openssl x509 -in server.cert.pem -text
openssl verify -CAfile root.cert.pem server.cert.pem

Act III: Install the certificates

You should have the following things now: a root key, a root certificate, a server key and a server certificate. Each of these needs to be used a little differently.

Quick check

openssl s_server -accept 8080 -www \
                 -key server.key.pem -cert server.cert.pem
openssl s_client -connect localhost:8080 -CAfile root.cert.pem \
                 2>/dev/null </dev/null \
                 | grep "Verify return code"

Credits

This website is an open source project, and your help would be greatly appreciated.