Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
720 views
in Technique[技术] by (71.8m points)

php - Guzzle Curl Error 60 SSL unable to get local issuer

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...