You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2015/06/25 18:24:39 UTC

svn commit: r1687571 - /tomcat/native/trunk/native/src/ssl.c

Author: jfclere
Date: Thu Jun 25 16:24:38 2015
New Revision: 1687571

URL: http://svn.apache.org/r1687571
Log:
Add missing initialization. It cores without is when using client certificates.

Modified:
    tomcat/native/trunk/native/src/ssl.c

Modified: tomcat/native/trunk/native/src/ssl.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/ssl.c?rev=1687571&r1=1687570&r2=1687571&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/ssl.c (original)
+++ tomcat/native/trunk/native/src/ssl.c Thu Jun 25 16:24:38 2015
@@ -1137,6 +1137,7 @@ TCN_IMPLEMENT_CALL(jlong /* SSL * */, SS
     tcn_ssl_ctxt_t *c = J2P(ctx, tcn_ssl_ctxt_t *);
     int *handshakeCount = malloc(sizeof(int));
     SSL *ssl;
+    tcn_ssl_conn_t *con;
 
     UNREFERENCED_STDARGS;
 
@@ -1146,6 +1147,14 @@ TCN_IMPLEMENT_CALL(jlong /* SSL * */, SS
         tcn_ThrowException(e, "cannot create new ssl");
         return 0;
     }
+    if ((con = apr_pcalloc(c->pool, sizeof(tcn_ssl_conn_t))) == NULL) {
+        tcn_ThrowAPRException(e, apr_get_os_error());
+        return NULL;
+    }
+    con->pool = c->pool;
+    con->ctx  = c;
+    con->ssl  = ssl;
+    con->shutdown_type = c->shutdown_type;
 
     /* Store the handshakeCount in the SSL instance. */
     *handshakeCount = 0;
@@ -1166,6 +1175,7 @@ TCN_IMPLEMENT_CALL(jlong /* SSL * */, SS
 
     /* Store for later usage in SSL_callback_SSL_verify */
     SSL_set_app_data2(ssl, c);
+    SSL_set_app_data(ssl, con);
     return P2J(ssl);
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org