DEV Community

Nitin Reddy
Nitin Reddy

Posted on

Creating Certificates with certie

To setup TLS/SSL for web servers, X.509 client authentication, or even for database servers, you need to have certificate files. The quickest way to generate them, assuming you are on MacOS/Linux, is with certie.

Installing certie is simple:

sudo gem install certie
Enter fullscreen mode Exit fullscreen mode

Following the installation, generating the certificates is as simple as:

certie dev.mymachine.local
Enter fullscreen mode Exit fullscreen mode

This creates a root certificate and a server certificate in PEM format within the current directory.

You may want to change the subject prefix by editing the ".certie_subjprefix" file in your home directory. Note that if you change the subject prefix, you would need to start over (delete the contents of the current directory, or create a new directory).

Dependencies

If you were unable to successfully execute "gem install certie" above, you likely need to install Ruby and OpenSSL dependencies.

If you are on RedHat, you may need to install build tools and Ruby:

sudo yum groupinstall -y "Development Tools"
sudo yum install -y ruby-devel openssl-devel
Enter fullscreen mode Exit fullscreen mode

For Ubuntu/Debian, the dependencies are installed with:

sudo apt install -y ruby-dev libssl-dev build-essential
Enter fullscreen mode Exit fullscreen mode

Discussion (0)