Commit ed9a4e65 authored by Marvin Scholz's avatar Marvin Scholz

Cleanup: Simplify OpenSSL context initialisation

Assigning the return value of SSLv23_server_method to a variable is
not necessary here and not doing it can get us rid of a lot of
condition code given that the type of the return value changed
at some point.
parent 07304b51
......@@ -68,11 +68,6 @@ void tls_shutdown(void)
tls_ctx_t *tls_ctx_new(const char *cert_file, const char *key_file, const char *cipher_list)
tls_ctx_t *ctx;
SSL_METHOD *method;
const SSL_METHOD *method;
long ssl_opts;
if (!cert_file || !key_file || !cipher_list)
......@@ -82,10 +77,8 @@ tls_ctx_t *tls_ctx_new(const char *cert_file, const char *key_file, const char *
if (!ctx)
return NULL;
method = SSLv23_server_method();
ctx->refc = 1;
ctx->ctx = SSL_CTX_new(method);
ctx->ctx = SSL_CTX_new(SSLv23_server_method());
ssl_opts = SSL_CTX_get_options(ctx->ctx);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment