File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Curl defaulting to default CA root store, especially in Windows
3
+ --EXTENSIONS--
4
+ curl
5
+ --DESCRIPTION--
6
+ On Windows, there is no fallback root CA store, so all HTTPS requests that require validation (default)
7
+ fail by default. Curl >= 7.71.0 has a CURLOPT_SSL_OPTIONS = CURLSSLOPT_NATIVE_CA option that falls back
8
+ to Windows root CA store.
9
+ --SKIPIF--
10
+ <?php
11
+ if (getenv ("SKIP_ONLINE_TESTS " )) die ("skip online test " );
12
+ $ curl_version = curl_version ();
13
+ if ($ curl_version ['version_number ' ] < 0x074700 ) {
14
+ die ("skip: test works only with curl >= 7.71.0 " );
15
+ }
16
+ ?>
17
+ --INI--
18
+
19
+ --FILE--
20
+ <?php
21
+ $ ch = curl_init ('https://sha256.badssl.com/ ' );
22
+ $ cert = curl_getinfo ($ ch , CURLINFO_CAINFO );
23
+ var_dump ($ cert );
24
+ curl_setopt_array ($ ch , [
25
+ CURLOPT_RETURNTRANSFER => true ,
26
+ CURLOPT_SSL_VERIFYHOST => 2 ,
27
+ CURLOPT_SSL_VERIFYPEER => 1 ,
28
+ ]);
29
+
30
+ curl_exec ($ ch );
31
+ var_dump (curl_getinfo ($ ch , CURLINFO_SSL_VERIFYRESULT ));
32
+
33
+ ?>
34
+ --EXPECT--
35
+ int(0)
You can’t perform that action at this time.
0 commit comments