diff options
Diffstat (limited to 'test/ssl_test.c')
-rw-r--r-- | test/ssl_test.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/test/ssl_test.c b/test/ssl_test.c index 0062c51..176f6a1 100644 --- a/test/ssl_test.c +++ b/test/ssl_test.c @@ -177,10 +177,25 @@ static int execute_test(SSL_TEST_FIXTURE fixture) SSL_TEST_CTX *test_ctx = NULL; HANDSHAKE_RESULT result; - server_ctx = SSL_CTX_new(TLS_server_method()); - server2_ctx = SSL_CTX_new(TLS_server_method()); - client_ctx = SSL_CTX_new(TLS_client_method()); - OPENSSL_assert(server_ctx != NULL && server2_ctx != NULL && client_ctx != NULL); + test_ctx = SSL_TEST_CTX_create(conf, fixture.test_app); + if (test_ctx == NULL) + goto err; + +#ifndef OPENSSL_NO_DTLS + if (test_ctx->method == SSL_TEST_METHOD_DTLS) { + server_ctx = SSL_CTX_new(DTLS_server_method()); + server2_ctx = SSL_CTX_new(DTLS_server_method()); + client_ctx = SSL_CTX_new(DTLS_client_method()); + } +#endif + if (test_ctx->method == SSL_TEST_METHOD_TLS) { + server_ctx = SSL_CTX_new(TLS_server_method()); + server2_ctx = SSL_CTX_new(TLS_server_method()); + client_ctx = SSL_CTX_new(TLS_client_method()); + } + + OPENSSL_assert(server_ctx != NULL && server2_ctx != NULL && + client_ctx != NULL); OPENSSL_assert(CONF_modules_load(conf, fixture.test_app, 0) > 0); |