sslcerts v0.1.2 Sslcerts.Config View Source

There are a few ways to configure your SSL certs

Let’s say your host is namedb.org, then you can configure you application through Mix Tasks, as follows:

mix sslcerts.init
mix sslcerts.config host namedb.org

And to confirm it’s set, run

mix sslcerts.config

And the output should look similar to:

domains: ["FILL_ME_IN.com"]
email: "YOUR_EMAIL_HERE"
ini: "/etc/letsencrypt/letsencrypt.ini"
keysize: 4096

You can achieve similar behvarious through an iEX session iex -S mix

Sslcerts.Config.init
"/Users/aforward/.sslcerts"

Sslcerts.Config.put(:domains, ["namedb.org"])
:ok

Sslcerts.Config.read
%{domains: ["namedb.org"]}

The information above is cached in the Sslcerts.Worker, so if you are making changes in iEX, you can reload your configs using

iex> Sslcerts.reload
:ok

And you can see the currently cached values with

Sslcerts.config
%{domains: ["namedb.org"]}

The order of preference for locating the appropriate configs are

#1 Environment variable storing the path to the file
SSLCERTS_CONFIG=/tmp/my.sslcerts

#2 Elixir built in Mix.Config
use Mix.Config
config :sslcerts, config:  %{domains: ["mysite.local"]}

#3 A file within "myproject" called .sslcerts
/src/myproject/.sslcerts

# A file within the home directory called .sslcerts
~/.sslcerts

You could overwrite the location, but that’s mostly for testing, so unless you have a really valid reason do to so, please don’t.

Link to this section Summary

Link to this section Functions

Link to this macro invoke(piped_in_argument, expr) View Source (macro)
Link to this function put(filename, key, value) View Source