Index: proftpd-dfsg-1.3.6/contrib/mod_tls.c
===================================================================
--- proftpd-dfsg-1.3.6.orig/contrib/mod_tls.c
+++ proftpd-dfsg-1.3.6/contrib/mod_tls.c
@@ -951,7 +951,10 @@ static void tls_info_cb(const SSL *ssl,
     }
 
   } else if (where & SSL_CB_HANDSHAKE_DONE) {
-    if (ssl == ctrl_ssl) {
+    /* ctrl_ssl is NULL if this is our initial ctrl SSL, and the handshake has
+     * not be completed yet.
+     */
+    if (ctrl_ssl == NULL) {
       if (tls_ctrl_need_init_handshake == FALSE) {
         int reused;
 

