janetls
janetls copied to clipboard
Client TLS: add x509_crt
mbedtls_ssl_* requires an x509 certificate chain object when verify is MBEDTLS_SSL_VERIFY_OPTIONAL or MBEDTLS_SSL_VERIFY_REQUIRED.
mbedtls_ssl_conf_authmode( &conf, MBEDTLS_SSL_VERIFY_OPTIONAL );
mbedtls_ssl_conf_ca_chain( &conf, &cacert, NULL );
mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg );
mbedtls_ssl_conf_dbg( &conf, my_debug, stdout );
For this to work, an x509 certificate chain object must be available with functionality such as
- Load from PEM str
- Load from DER str
Functionality such as the following are out of scope for this issue.
- Verifying a certificate chain
- Writing a certificate
- Generating a certificate
- Loading system certificates
Done in b65ec4946145ab71ed717f6c1cb11914359796b2
Only going with DER string support for now. Loading functionality to be facilitated through nicer API in janet side with pem.