Switch to using NULL server.ssl_fd to mark new SSL connection instead of NULL server.ctx

server.ctx is now allocated once for each server on first connection, then reused for subsequent connections.

server.ctx wasn't being cleared when the server was closed (as server.ssl_fd is), so this was causing
reconnection to fail until try_connect() got called.

This also removes the last uses of the CHK_* macros in ssl.h, so remove them.
This commit is contained in:
Kevin Easton committed 2017-12-03 02:16:39 +11:00
1 parent 7b817dd9d2
commit 7642e741b9
3 files changed
+55 -29

No files matched your search

-4
View File
@@ -17,10 +17,6 @@
#define FALSE 1
#endif
#define CHK_NULL(x) if ((x)==NULL) { say("SSL error - NULL data form server"); close_server(refnum, empty_string); return(-1); }
#define CHK_ERR(err,s) if ((err)==-1) { say("SSL prime error - %s",s); close_server(refnum, empty_string); return(-1); }
#define CHK_SSL(err) if ((err)==-1) { say("SSL CHK error - %d %d",err,SSL_get_error(server_list[refnum].ssl_fd, err)); close_server(refnum, empty_string); return(-2); }
void SSL_show_errors(void);
/* Make these what you want for cert & key files */