View Source mix spaceboy.gen.cert (Spaceboy v0.3.2)

Generates self-signed certificate for localhost and saves it at priv/ssl/

By default uses EC prime256v1 as it is the most widely supported EC algorithm. But once support for ED25519 curve will grow I will switch it to this one for security reasons and to promote good practices. If you want to use ED25519 even now you can use --ed25519 option in this task.

When first used it copies default openssl.cnf to your priv/ssl/ directory and generates self-signed certificate for localhost and 127.0.0.1. If you want certificate for different hosts and IPs you can edit the generated priv/ssl/openssl.cnf file manually, generate new certificate and it will use those values instead.

Options

You can specify how many days certificate should be valid. Default is 365 days but you can specify different one (e.g. 100 years):

mix spaceboy.gen.cert --days 36500

You can specify to generate private key with ED25519 algorithm:

mix spaceboy.gen.cert --ed25519

Dependencies

This mix task is calling openssl program so you need to have it installed and in path.