Skip to content

Commit 2c0d47c

Browse files
committed
Revert "Fix tests regarding OpenSSL security_level"
This reverts commit b281493.
1 parent 51e3cb3 commit 2c0d47c

File tree

3 files changed

+18
-36
lines changed

3 files changed

+18
-36
lines changed

ext/openssl/tests/tls_min_v1.0_max_v1.1_wrapper.phpt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ $certFile = __DIR__ . DIRECTORY_SEPARATOR . 'tls_min_v1.0_max_v1.1_wrapper.pem.t
1111

1212
$serverCode = <<<'CODE'
1313
$flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
14-
$ssl_opts = [
14+
$ctx = stream_context_create(['ssl' => [
1515
'local_cert' => '%s',
1616
'min_proto_version' => STREAM_CRYPTO_PROTO_TLSv1_0,
1717
'max_proto_version' => STREAM_CRYPTO_PROTO_TLSv1_1,
18-
];
19-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
20-
$ssl_opts['security_level'] = 1;
21-
}
22-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
18+
'security_level' => 1,
19+
]]);
2320
2421
$server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
2522
phpt_notify();
@@ -32,14 +29,11 @@ $serverCode = sprintf($serverCode, $certFile);
3229

3330
$clientCode = <<<'CODE'
3431
$flags = STREAM_CLIENT_CONNECT;
35-
$ssl_opts = [
32+
$ctx = stream_context_create(['ssl' => [
3633
'verify_peer' => false,
3734
'verify_peer_name' => false,
38-
];
39-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
40-
$ssl_opts['security_level'] = 1;
41-
}
42-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
35+
'security_level' => 1,
36+
]]);
4337
4438
phpt_wait();
4539

ext/openssl/tests/tlsv1.0_wrapper.phpt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ $certFile = __DIR__ . DIRECTORY_SEPARATOR . 'tlsv1.0_wrapper.pem.tmp';
1111

1212
$serverCode = <<<'CODE'
1313
$flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
14-
$ssl_opts = [
14+
$ctx = stream_context_create(['ssl' => [
1515
'local_cert' => '%s',
16-
];
17-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
18-
$ssl_opts['security_level'] = 1;
19-
}
20-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
16+
'security_level' => 1,
17+
]]);
2118
2219
$server = stream_socket_server('tlsv1.0://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
2320
phpt_notify();
@@ -30,14 +27,11 @@ $serverCode = sprintf($serverCode, $certFile);
3027

3128
$clientCode = <<<'CODE'
3229
$flags = STREAM_CLIENT_CONNECT;
33-
$ssl_opts = [
30+
$ctx = stream_context_create(['ssl' => [
3431
'verify_peer' => false,
3532
'verify_peer_name' => false,
36-
];
37-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
38-
$ssl_opts['security_level'] = 1;
39-
}
40-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
33+
'security_level' => 1,
34+
]]);
4135
4236
phpt_wait();
4337

ext/openssl/tests/tlsv1.1_wrapper.phpt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ $certFile = __DIR__ . DIRECTORY_SEPARATOR . 'tlsv1.1_wrapper.pem.tmp';
1111

1212
$serverCode = <<<'CODE'
1313
$flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN;
14-
$ssl_opts = [
14+
$ctx = stream_context_create(['ssl' => [
1515
'local_cert' => '%s',
16-
];
17-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
18-
$ssl_opts['security_level'] = 1;
19-
}
20-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
16+
'security_level' => 1,
17+
]]);
2118
2219
$server = stream_socket_server('tlsv1.1://127.0.0.1:64321', $errno, $errstr, $flags, $ctx);
2320
phpt_notify();
@@ -30,14 +27,11 @@ $serverCode = sprintf($serverCode, $certFile);
3027

3128
$clientCode = <<<'CODE'
3229
$flags = STREAM_CLIENT_CONNECT;
33-
$ssl_opts = [
30+
$ctx = stream_context_create(['ssl' => [
3431
'verify_peer' => false,
3532
'verify_peer_name' => false,
36-
];
37-
if (OPENSSL_VERSION_NUMBER >= 0x10100000) {
38-
$ssl_opts['security_level'] = 1;
39-
}
40-
$ctx = stream_context_create(['ssl' => $ssl_opts]);
33+
'security_level' => 1,
34+
]]);
4135
4236
phpt_wait();
4337

0 commit comments

Comments
 (0)