xref: /PHP-5.6/ext/openssl/tests/bug65538_002.phpt (revision e9c9169e)
1--TEST--
2Bug #65538: SSL context "cafile" disallows URL stream wrappers
3--SKIPIF--
4<?php
5if (!extension_loaded('openssl')) die('skip, openssl required');
6if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
7--FILE--
8<?php
9$clientCtx = stream_context_create(['ssl' => [
10    'cafile' => 'http://curl.haxx.se/ca/cacert.pem'
11]]);
12file_get_contents('https://github.com', false, $clientCtx);
13--EXPECTF--
14Warning: remote cafile streams are disabled for security purposes in %s on line %d
15
16Warning: file_get_contents(): Failed to enable crypto in %s on line %d
17
18Warning: file_get_contents(%s): failed to open stream: operation failed in %s on line %d
19