summaryrefslogtreecommitdiff
path: root/vio/viossl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vio/viossl.c')
-rw-r--r--vio/viossl.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/vio/viossl.c b/vio/viossl.c
index a4f0a1bd213..2bee31f66ab 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -26,6 +26,20 @@
#ifdef HAVE_OPENSSL
+#ifdef HAVE_YASSL
+/*
+ yassl seem to be different here, SSL_get_error() value can be
+ directly passed to ERR_error_string(), and these errors don't go
+ into ERR_get_error() stack.
+ in openssl, apparently, SSL_get_error() values live in a different
+ namespace, one needs to use ERR_get_error() as an argument
+ for ERR_error_string().
+*/
+#define SSL_errno(X,Y) SSL_get_error(X,Y)
+#else
+#define SSL_errno(X,Y) ERR_get_error()
+#endif
+
#ifndef DBUG_OFF
static void
@@ -48,8 +62,8 @@ report_errors(SSL* ssl)
if (ssl)
{
#ifndef DBUG_OFF
- int error= SSL_get_error(ssl, l);
- DBUG_PRINT("error", ("error: %s (%d)",
+ ulong error= SSL_errno(ssl, l);
+ DBUG_PRINT("error", ("error: %s (%lu)",
ERR_error_string(error, buf), error));
#endif
}
@@ -390,7 +404,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
if ((r= ssl_handshake_loop(vio, ssl, func)) < 1)
{
DBUG_PRINT("error", ("SSL_connect/accept failure"));
- *errptr= SSL_get_error(ssl, r);
+ *errptr= SSL_errno(ssl, r);
SSL_free(ssl);
vio_blocking(vio, was_blocking, &unused);
DBUG_RETURN(1);