Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
NAME
tls_load_file, tls_unload_file, tls_config_set_ca_file, tls_config_set_ca_path, tls_config_set_ca_mem, tls_config_set_cert_file, tls_config_set_cert_mem, tls_config_set_crl_file, tls_config_set_crl_mem, tls_config_set_key_file, tls_config_set_key_mem, tls_config_set_ocsp_staple_mem, tls_config_set_ocsp_staple_file, tls_config_set_keypair_file, tls_config_set_keypair_mem, tls_config_set_keypair_ocsp_file, tls_config_set_keypair_ocsp_mem, tls_config_add_keypair_file, tls_config_add_keypair_ocsp_mem, tls_config_add_keypair_ocsp_file, tls_config_add_keypair_mem, tls_config_clear_keys, tls_config_set_verify_depth, tls_config_verify_client, tls_config_verify_client_optional, tls_default_ca_cert_file — TLS certificate and key configurationSYNOPSIS
#include <tls.h>tls_load_file(const char *file, size_t *len, char *password);
tls_unload_file(uint8_t *buf, size_t len);
tls_config_set_ca_file(struct tls_config *config, const char *ca_file);
tls_config_set_ca_path(struct tls_config *config, const char *ca_path);
tls_config_set_ca_mem(struct tls_config *config, const uint8_t *cert, size_t len);
tls_config_set_cert_file(struct tls_config *config, const char *cert_file);
tls_config_set_cert_mem(struct tls_config *config, const uint8_t *cert, size_t len);
tls_config_set_crl_file(struct tls_config *config, const char *crl_file);
tls_config_set_crl_mem(struct tls_config *config, const uint8_t *crl, size_t len);
tls_config_set_key_file(struct tls_config *config, const char *key_file);
tls_config_set_key_mem(struct tls_config *config, const uint8_t *key, size_t len);
tls_config_set_ocsp_staple_mem(struct tls_config *config, const uint8_t *staple, size_t len);
tls_config_set_ocsp_staple_file(struct tls_config *config, const char *staple_file);
tls_config_set_keypair_file(struct tls_config *config, const char *cert_file, const char *key_file);
tls_config_set_keypair_mem(struct tls_config *config, const uint8_t *cert, size_t cert_len, const uint8_t *key, size_t key_len);
tls_config_set_keypair_ocsp_file(struct tls_config *config, const char *cert_file, const char *key_file, const char *staple_file);
tls_config_set_keypair_ocsp_mem(struct tls_config *config, const uint8_t *cert, size_t cert_len, const uint8_t *key, size_t key_len, const uint8_t *staple, size_t staple_len);
tls_config_add_keypair_file(struct tls_config *config, const char *cert_file, const char *key_file);
tls_config_add_keypair_mem(struct tls_config *config, const uint8_t *cert, size_t cert_len, const uint8_t *key, size_t key_len);
tls_config_add_keypair_ocsp_file(struct tls_config *config, const char *cert_file, const char *key_file, const char *staple_file);
tls_config_add_keypair_ocsp_mem(struct tls_config *config, const uint8_t *cert, size_t cert_len, const uint8_t *key, size_t key_len, const uint8_t *staple, size_t staple_len);
tls_config_clear_keys(struct tls_config *config);
tls_config_set_verify_depth(struct tls_config *config, int verify_depth);
tls_config_verify_client(struct tls_config *config);
tls_config_verify_client_optional(struct tls_config *config);
tls_default_ca_cert_file(void);
DESCRIPTION
tls_load_file() loads a certificate or key from disk into memory to be used with tls_config_set_ca_mem(), tls_config_set_cert_mem(), tls_config_set_crl_mem() or tls_config_set_key_mem(). A private key will be decrypted if the optional password argument is specified.RETURN VALUES
tls_load_file() returns NULL on error or an out of memory condition.SEE ALSO
tls_config_ocsp_require_stapling(3), tls_config_set_protocols(3), tls_config_set_session_id(3), tls_configure(3), tls_init(3)HISTORY
tls_config_set_ca_file(), tls_config_set_ca_path(), tls_config_set_cert_file(), tls_config_set_cert_mem(), tls_config_set_key_file(), tls_config_set_key_mem(), and tls_config_set_verify_depth() appeared in OpenBSD 5.6 and got their final names in OpenBSD 5.7.AUTHORS
<jsing@openbsd.org> with contributions from<tedu@openbsd.org> and
<beck@openbsd.org>.
<reyk@openbsd.org>.