Im using openssl (the development library, <openssl/ssl.h>
) to program a small, simple server in C. Since Im only testing it locally, I use a self signed certificate. When first connecting, since my browser doesnt trust the certificate, SSL_accept()
returns SSL_ERROR_SSL
, which is fine, thats what should happen.
Im wondering how I should handle the error SSL_ERROR_SSL
, since the docs on SSL_get_error()
say:
SSL_ERROR_SSL
A non-recoverable, fatal error in the SSL library occurred, usually a protocol error. The OpenSSL error queue contains more information on the error. If this error occurs then no further I/O operations should be performed on the connection and SSL_shutdown() must not be called.
If I cant canSSL_shutdown()
, what do I do with the ssl connection? How do I reuse theSSL*
object? And why cant I callSSL_shutdown()
?
I tried looking at the error queue, which gave me the expected error of untrusted certificate. Openssl.org doesnt have any answers, and it seems that most programs try to avoid handling this problem instead of dealing with it.
Soikk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.