Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls/alloc: set default min proto TLS 1.2 #948

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/tls/openssl/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ int tls_alloc(struct tls **tlsp, enum tls_method method, const char *keyfile,
{
struct tls *tls;
int r, err;
int min_proto = 0;

if (!tlsp)
return EINVAL;
Expand All @@ -250,6 +251,7 @@ int tls_alloc(struct tls **tlsp, enum tls_method method, const char *keyfile,
case TLS_METHOD_TLS:
case TLS_METHOD_SSLV23:
tls->ctx = SSL_CTX_new(TLS_method());
min_proto = TLS1_2_VERSION;
break;

case TLS_METHOD_DTLS:
Expand All @@ -270,6 +272,10 @@ int tls_alloc(struct tls **tlsp, enum tls_method method, const char *keyfile,
goto out;
}

err = tls_set_min_proto_version(tls, min_proto);
if (err)
goto out;

#if defined(TRACE_SSL)
SSL_CTX_set_keylog_callback(tls->ctx, tls_keylogger_cb);
#endif
Expand Down