I've got an application that starts out with some default credentials, then is given new credentials that it needs to switch to.  I've got an SSL_CTX object that gets initialized with the default credentials at startup, but if I try to install a new certificate and key via SSL_CTX_use_certificate_chain_file or similar APIs I always get a cert/key mismatch error. I've tried installing the new private key first instead of the certificate, but it doesn't help.
 
I'd call ssl_cert_free() if I could, but it's a private API and isn't exported in DLLs.
 
Is there a way to get an SSL_CTX to use a new set of credentials?  I don't care about existing sessions - they'll still use the old credentials of course, but I need to have new sessions use the new credentials.  If not I guess I'll either have to keep the certificate/key out of the SSL_CTX and add it to each session on my own, or I'll have to create another SSL_CTX object and keep track of the old one and eventually delete it.
 
Any suggestions?  Hopefully I've missed something simple...
 
Eric

Reply via email to