I am using managed OpenSSL wrapper for mutual authentication in my project. What I have done till now is sent the client certificate by calling .Net's AuthenticateAsClient
function of SslStream
and I am getting server certificate along with 3 chain certificate in callback functions from server. But I don't know what to do with this server certificate. Now I have two questions:
Why am I getting
error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate
error when I am callingAuthenticateAsClient
function even if I have Root CA installed on local machine?How to add server certificate which I have got in callback function from server into key store using managed OpenSSL or what else need to do with this server certificate to finish mutual authentication?
Can anyone please help me to complete this mutual authentication process using OpenSSL.