- if (SSL_CTX_remove_session(cctx, sess2)) {
- printf("Unexpected success removing session from cache\n");
+#ifndef OPENSSL_NO_TLS1_1
+ /* Force a connection failure */
+ SSL_CTX_set_max_proto_version(sctx, TLS1_1_VERSION);
+ clientssl3 = SSL_new(cctx);
+ if (clientssl3 == NULL) {
+ printf("Malloc failure\n");
+ goto end;
+ }
+ if (!SSL_set_session(clientssl3, sess1)) {
+ printf("Unable to set session for third connection\n");
+ goto end;
+ }
+
+ /* This should fail because of the mismatched protocol versions */
+ if (create_ssl_connection(sctx, cctx, &serverssl3, &clientssl3, NULL,
+ NULL)) {
+ printf("Unexpected success creating SSL connection\n");
+ goto end;
+ }
+
+ /* We should have automatically removed the session from the cache */
+ if (fix.use_ext_cache && (new_called != 2 || remove_called != 3)) {
+ printf("Failed to call callback to remove session #2\n");