diff options
author | Nick White <git@njw.name> | 2020-03-17 09:13:39 +0000 |
---|---|---|
committer | Nick White <git@njw.name> | 2020-03-17 09:13:39 +0000 |
commit | f89fb6e4cd9b33fb27bd50b90d160b7644fdd480 (patch) | |
tree | 9e1ada75d4d4d550ac071f669602c6b6ba24a14c | |
parent | 6e989a0f7491290ca3b24c39e3b65aecdd082721 (diff) |
Update libssl usage to avoid using deprecated TLSv1_2_client_method
-rw-r--r-- | util.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -58,7 +58,10 @@ conn *dial(char *host, char *port, int ssl) if(ssl) { SSL_load_error_strings(); SSL_library_init(); - if((sslcontext = SSL_CTX_new(TLSv1_2_client_method())) == NULL) { + if((sslcontext = SSL_CTX_new(TLS_client_method())) == NULL) { + ERR_print_errors_fp(stderr); + } + if(SSL_CTX_set_min_proto_version(sslcontext, TLS1_2_VERSION) != 1) { ERR_print_errors_fp(stderr); } if((c->sslhandle = SSL_new(sslcontext)) == NULL) { |