So I’m writing some C code to connect to a server that is expecting me to provide a certificate for authentication. I’m using OpenSSL to do the SSL communications and I’ve got the socket code worked out, and I have code to do the SSL part worked out to, but what I can’t seem to get simply because the docs are so sparse is how to implement the function:
SSL_CTX_set_client_cert_cb
If any one has any tips I would greatly appreciate it.
You do not need to use
SSL_CTX_set_client_cert_cb(). The simplest way is to useSSL_use_certificate_file()to set the certificate andSSL_use_PrivateKey_file()to set the corresponding private key, before callingSSL_connect().