z_ssl_certs (zotonic_core v1.0.0-rc.17)

SSL support functions, create self-signed certificates

Summary

Functions

Check if all certificates are available in the site's ssl directory

Fetch the ssi options for the site context.

Fetch the ssl options for the given hostname and site context. If there is is no module observing ssl_options, then return the self signed certificates.

Sign data using the current private key and sha256

Callback for SSL SNI, match the hostname to a set of keys

Return the options to use for non-sni ssl

Functions

ensure_self_signed(Hostname)

-spec ensure_self_signed(string()) -> {ok, [ssl:tls_option()]} | {error, term()}.

Check if all certificates are available in the site's ssl directory

get_ssl_options(Context)

-spec get_ssl_options(z:context() | undefined) -> [ssl:tls_option()] | undefined.

Fetch the ssi options for the site context.

get_ssl_options(Hostname, Context)

-spec get_ssl_options(binary(), z:context()) -> [ssl:tls_option()] | undefined.

Fetch the ssl options for the given hostname and site context. If there is is no module observing ssl_options, then return the self signed certificates.

sign(Data, Context)

-spec sign(iodata(), z:context()) -> {ok, binary()} | {error, term()}.

Sign data using the current private key and sha256

sni_fun(Hostname)

-spec sni_fun(string()) -> [ssl:tls_option()] | undefined.

Callback for SSL SNI, match the hostname to a set of keys

sni_self_signed(Hostname)

-spec sni_self_signed(string() | binary()) -> [ssl:tls_option()] | undefined.

ssl_listener_options()

-spec ssl_listener_options() -> [ssl:tls_option()].

Return the options to use for non-sni ssl