@@ -43,6 +43,7 @@ public function __construct(array $options = [])
43
43
CURLOPT_FAILONERROR => true ,
44
44
CURLOPT_FOLLOWLOCATION => true ,
45
45
CURLOPT_RETURNTRANSFER => true ,
46
+ CURLOPT_SSL_VERIFYPEER => false ,
46
47
CURLOPT_HTTPGET => true ,
47
48
];
48
49
@@ -59,18 +60,16 @@ public function __construct(array $options = [])
59
60
*/
60
61
public function getContent (string $ url ): string
61
62
{
62
- $ options = $ this ->options ;
63
- $ options [CURLOPT_URL ] = $ url ;
64
- $ curl = curl_init ();
65
- curl_setopt_array ($ curl , $ options );
63
+ $ curl = curl_init ($ url );
64
+ curl_setopt_array ($ curl , $ this ->options );
66
65
$ content = curl_exec ($ curl );
67
- $ code = curl_errno ($ curl );
68
- $ message = curl_error ($ curl );
66
+ $ error_code = curl_errno ($ curl );
67
+ $ error_message = curl_error ($ curl );
69
68
curl_close ($ curl );
70
- if (CURLE_OK === $ code ) {
69
+ if (CURLE_OK === $ error_code ) {
71
70
return $ content ;
72
71
}
73
72
74
- throw new HttpClientException ($ message , $ code );
73
+ throw new HttpClientException ($ error_message , $ error_code );
75
74
}
76
75
}
0 commit comments