No matching definitions.

tls/ctx

src/tls/ctx.tur
defn

tls-ctx-new

(tls-ctx-new :)

allocate and initialize a new server-side TLS context.

Handle as :int on success; 0 on allocation or RNG seed failure.

(let [ctx (tls-ctx-new)]
    (tls-ctx-load-cert-pem ctx "cert.pem")
    (tls-ctx-load-key-pem  ctx "key.pem")
    ...
    (tls-ctx-free ctx))

Since: T2

defn

tls-ctx-free

(tls-ctx-free [ctx : int] :)

release a TLS context and every mbedTLS sub-object it owns.

ctxhandle returned by tls-ctx-new. 0 is a safe no-op.

Since: T2

defn

tls-ctx-load-cert-pem

(tls-ctx-load-cert-pem [ctx : int path : cstr] :)

load a PEM certificate chain into the context.

ctxhandle from tls-ctx-new.
pathfilesystem path to a PEM file containing the server cert
(optionally followed by any intermediate certs).

0 on success; non-zero mbedTLS error code on failure (file missing, not a PEM, malformed, etc.).

Since: T2

defn

tls-ctx-load-key-pem

(tls-ctx-load-key-pem [ctx : int path : cstr] :)

load a PEM private key and finalize the conf binding.

ctxhandle from tls-ctx-new.
pathfilesystem path to a PEM-encoded private key (unencrypted).

0 on success; non-zero mbedTLS error code on key-parse or conf-bind failure.

Since: T2