I’m needing to write a simple SSL client application to query the Amazon Web Service from C++. It’s going to be used in multi-threaded applications.
This is the first time I’ve ever looked at using OpenSSL and I’m needing to extend some of our our libraries to support SSL sockets.
My question is: What is the purpose of the SSL_CTX_set_default_passwd_cb function in OpenSSL?
In reading the man page it’s not particularly clear what it does exactly. As suggested function from the man page is this.
int pem_passwd_cb(char *buf, int size, int rwflag, void *password)
{
strncpy(buf, (char *)(password), size);
buf[size - 1] = '\0';
return(strlen(buf));
}
According to this article, This callback is called when a password is required to decrypt an encrypted private key