cURL error 60: SSL certificate problem: self signed certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

by kyo   Last Updated August 11, 2019 11:26 AM

I use Guzzle in my Laravel 5.8 project

I'm trying to make a GET to a URL (signed cert) serve on https

"https://172.1.1.1:443/accounts"

public static function get($url) {

    // dd($url);

    try {
        $client = new Client();
        $options = [
            'http_errors'     => true,
            'connect_timeout' => 3.14,
            'read_timeout'    => 3.14,
            'timeout'         => 3.14,
            'curl'            => array(
                CURLOPT_SSL_VERIFYHOST => false,
                CURLOPT_SSL_VERIFYPEER => false
            )

        ];

        $headers = [
            'headers' => [
                'Keep-Alive' => 'timeout=300'
            ]
        ];

        $result = $client->request('GET', $url, $headers, $options);


        // dd($result);



    } catch (ConnectException $e) {

        //Logging::error($e);

        return null;
    }

    return json_decode($result->getBody(), true);
}

I used these 2 flags already

CURLOPT_SSL_VERIFYHOST => false,
URLOPT_SSL_VERIFYPEER => false

I'm not sure why I kept getting,



Related Questions


PHP GuzzleHttp get response Location header

Updated August 29, 2019 14:26 PM

Laravel Guzzle params

Updated May 28, 2017 09:26 AM


HttpGuzzle 6, Post Request With Data and File

Updated May 06, 2019 17:26 PM