Remove old style NewSessionTicket from TLSv1.3
[openssl.git] / test / clienthellotest.c
index b8157f23c657b27a1ce947b0a456dfca2cc094f5..4219598846c0cafdbbab67b4f38cfa45817ec19d 100644 (file)
@@ -56,10 +56,26 @@ int main(int argc, char *argv[])
     for (; currtest < TOTAL_NUM_TESTS; currtest++) {
         testresult = 0;
         ctx = SSL_CTX_new(TLS_method());
+
+        /*
+         * This test is testing session tickets for <= TLS1.2. It isn't relevant
+         * for TLS1.3
+         */
+        if (ctx == NULL || !SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION))
+            goto end;
+
         con = SSL_new(ctx);
+        if (con == NULL)
+            goto end;
 
         rbio = BIO_new(BIO_s_mem());
         wbio = BIO_new(BIO_s_mem());
+        if (rbio == NULL || wbio == NULL) {
+            BIO_free(rbio);
+            BIO_free(wbio);
+            goto end;
+        }
+
         SSL_set_bio(con, rbio, wbio);
         SSL_set_connect_state(con);