If you get an error result from either SSL_connect or SSL_accept you should
call SSL_get_error. This can give you a number of different results
indicating such things as remote end closing connection, system error, ssl
protocol error, write blocked or read blocked. In the case of the last two
you
Hopefully you are doing add_ssl_algorithms(..) (and a helpful
SSL_load_error_strings(..)) in the beginning. Also, did you try
ERR_print_errors_fp(stdout) and see if something appears? I may be restating
the obvious here.
The usual way I detect errors is to do a SSL_get_error(..) and do a
switch-c