Guzzle Curl Error 60 SSL unable to get local issuer

RedactedProfile picture RedactedProfile · Jul 24, 2014 · Viewed 45.1k times · Source

Trying to use the YouTube API v3 to get some video(s) information, using Guzzle in Symfony2 using Service Descriptors.

When I run the script, I get this:

[curl] 60: SSL certificate problem: unable to get local issuer certificate [url] https://www.googleapis.com/youtube/v3/videos?id=2xbVbCoHBgA&part=snippet&key={MY_KEY}

500 Internal Server Error - CurlException

My descriptor looks like this:

{
    "name": "YouTube",
    "baseUrl": "https://www.googleapis.com",
    "apiVersion": "v3",
    "description": "YouTube GData Graph API",
    "operations": {
        "GetVideos": {
            "httpMethod": "GET",
            "uri": "/youtube/v3/videos",
            "parameters": {
                "id": {
                    "type":"string",
                    "location":"query",
                    "required": true
                },
                "part": {
                    "location": "query",
                    "default": "snippet"
                },
                "key": {
                    "location": "query",
                    "default": "{MY KEY}",
                    "static": true
                },
                "maxResults": {
                    "location": "query",
                    "default": 50
                }
            }
        }
    }
}

This is running on a local Ubuntu 14.04 development environment with a very basic LAMP stack going on.

Any ideas as to what might be causing this?

Answer

reshetech picture reshetech · Sep 24, 2014

It can be that it is looking for the SSL certificate of your site.

If this is the case, try to disable the SSL certification:

$client->setDefaultOption('verify', false);