summaryrefslogtreecommitdiffstats
path: root/test/ssltestlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ssltestlib.c')
-rw-r--r--test/ssltestlib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ssltestlib.c b/test/ssltestlib.c
index 4473c670d7..f7dc65f734 100644
--- a/test/ssltestlib.c
+++ b/test/ssltestlib.c
@@ -511,6 +511,7 @@ static int mempacket_test_puts(BIO *bio, const char *str)
}
int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm,
+ int min_proto_version, int max_proto_version,
SSL_CTX **sctx, SSL_CTX **cctx, char *certfile,
char *privkeyfile)
{
@@ -521,6 +522,22 @@ int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm,
|| (cctx != NULL && !TEST_ptr(clientctx = SSL_CTX_new(cm))))
goto err;
+ if ((min_proto_version > 0
+ && !TEST_true(SSL_CTX_set_min_proto_version(serverctx,
+ min_proto_version)))
+ || (max_proto_version > 0
+ && !TEST_true(SSL_CTX_set_max_proto_version(serverctx,
+ max_proto_version))))
+ goto err;
+ if (clientctx != NULL
+ && ((min_proto_version > 0
+ && !TEST_true(SSL_CTX_set_min_proto_version(serverctx,
+ min_proto_version)))
+ || (max_proto_version > 0
+ && !TEST_true(SSL_CTX_set_max_proto_version(serverctx,
+ max_proto_version)))))
+ goto err;
+
if (!TEST_int_eq(SSL_CTX_use_certificate_file(serverctx, certfile,
SSL_FILETYPE_PEM), 1)
|| !TEST_int_eq(SSL_CTX_use_PrivateKey_file(serverctx, privkeyfile,