summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorIvan <micronn@gmail.com>2018-08-16 17:32:06 +0200
committerTingPing <tingping@tingping.se>2018-08-16 22:06:36 +0000
commitfd47adf59513398a92d9c82ec3668cf8a9ab3ddc (patch)
tree040ccbea3605f104b75fa5f9dfc9d8a223aec76e /src
parentcadc51ede9c390820552a597f3415db38f7b7818 (diff)
Fix inconsistent behavior (re)connecting on SSL
Diffstat (limited to 'src')
-rw-r--r--src/common/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/server.c b/src/common/server.c
index df98ef17..f2c5f91d 100644
--- a/src/common/server.c
+++ b/src/common/server.c
@@ -748,7 +748,6 @@ server_connect_success (server *serv)
 
 		/* it'll be a memory leak, if connection isn't terminated by
 		   server_cleanup() */
-		serv->ssl = _SSL_socket (serv->ctx, serv->sok);
 		if ((err = _SSL_set_verify (serv->ctx, ssl_cb_verify, NULL)))
 		{
 			EMIT_SIGNAL (XP_TE_CONNFAIL, serv->server_session, err, NULL,
@@ -756,6 +755,7 @@ server_connect_success (server *serv)
 			server_cleanup (serv);	/* ->connecting = FALSE */
 			return;
 		}
+		serv->ssl = _SSL_socket (serv->ctx, serv->sok);
 		/* FIXME: it'll be needed by new servers */
 		/* send(serv->sok, "STLS\r\n", 6, 0); sleep(1); */
 		set_nonblocking (serv->sok);