I have scoured Stack Overflow and the internet, but I have been unable to locate an answer to why ssl_accept() keeps returning:
[DEBUG] SSL_accept() : Failed
This is not a Diffie-Hellman library issue.
The reason you are getting the
error:00000005:lib(0):func(0):DH lib
is that you passed in the SSL_get_error() error code to ERR_error_string() which you should not do.
ERR_error_string() is only used on error codes from ERR_get_error().
See the help page for SSL_get_error() to know what the error means.