我试图向Symfony/Goutte的网站提出请求,但我收到这样的错误:
In ErrorChunk.php line 65:
SSL peer certificate or SSH remote key was not OK for "https://example.com".
In CurlResponse.php line 298:
SSL peer certificate or SSH remote key was not OK for "https://example.com".
代码如下:
use Goutte\Client;
$client = new Client();
$client->request('GET', 'https://example.com');
如何解决这个问题?
2条答案
按热度按时间ep6jt1vc1#
您需要添加HttpClient并禁用SSL检查...(仅在调试时这样做)而不是在生产中!
g6baxovj2#
如果你在localhost中工作,你可以在config/packages/frameworks.yaml中禁用SSL check globally,并粘贴以下内容:
希望对你有帮助!