views:

30

answers:

2

hello, 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.

A: 

You should read this book: "Network security with OpenSSL", from Pravir Chandra, Mat Messier and John Viega

pcent
+1  A: 

You do not need to use SSL_CTX_set_client_cert_cb(). The simplest way is to use SSL_use_certificate_file() to set the certificate and SSL_use_PrivateKey_file() to set the corresponding private key, before calling SSL_connect().

caf