[glib-openssl] connection: handle SSL_R_SHUTDOWN_WHILE_IN_INIT



commit 62c5db7bcb92ccac7208258dbe029192d24d84e5
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Tue Oct 17 09:57:29 2017 +0200

    connection: handle SSL_R_SHUTDOWN_WHILE_IN_INIT
    
    For some reason in ubuntu we get this error when shutting down
    the connection. Let's try to handle it so all our tests pass
    properly when running in ubuntu.

 tls/openssl/gtlsconnection-openssl.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index 0835bee..29494c2 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -151,6 +151,16 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
         }
     }
 
+  /* XXX: this error happens on ubuntu when shutting down the connection, it
+   * seems to be a bug in a specific version of openssl, so let's handle it
+   * gracefully
+   */
+  if (reason == SSL_R_SHUTDOWN_WHILE_IN_INIT)
+    {
+      g_clear_error (&my_error);
+      return G_TLS_CONNECTION_BASE_OK;
+    }
+
   if (reason == SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE)
     {
       g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]