File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,13 @@ if ($curl_version['version_number'] < 0x074700) {
18
18
--FILE--
19
19
<?php
20
20
21
- function check_error (CurlHandle $ ch ) {
21
+ function check_error (CurlHandle $ ch, $ expected = null ) {
22
22
if (curl_errno ($ ch ) !== 0 ) {
23
- echo "CURL ERROR: " . curl_errno ($ ch ) . "\n" ;
23
+ $ errno = curl_errno ($ ch );
24
+ if (!is_null ($ expected )) {
25
+ $ errno = $ errno == $ expected ? 'EXPECTED ' : "UNEXPECTED(A: $ errno,E: $ expected) " ;
26
+ }
27
+ echo "CURL ERROR: " . $ errno . "\n" ;
24
28
}
25
29
}
26
30
@@ -109,7 +113,7 @@ try {
109
113
110
114
$ response = curl_exec ($ ch );
111
115
check_response ($ response , $ clientCertSubject );
112
- check_error ($ ch );
116
+ check_error ($ ch, curl_version ()[ ' version_number ' ] < 0x081000 ? 58 : 43 );
113
117
curl_close ($ ch );
114
118
115
119
echo "\n" ;
@@ -203,7 +207,7 @@ bool(true)
203
207
bool(true)
204
208
bool(true)
205
209
client cert subject not in response
206
- CURL ERROR: 58
210
+ CURL ERROR: EXPECTED
207
211
208
212
case 4: client cert and key from file
209
213
bool(true)
You can’t perform that action at this time.
0 commit comments