谁能告诉我从文件中提取/转换证书.crt和私钥.key文件的正确方法/命令.pem?我刚读过它们是可以互换的,但不是如何.
我在本地开发环境中使用WAMP,我正在尝试从信用卡收费,但收到错误消息:
cURL错误60:SSL证书问题:无法获取本地颁发者证书
我在Google上搜索了很多,很多人都建议我下载这个文件:cacert.pem,把它放在某处并在我的php.ini中引用它.这是我的php.ini中的一部分:
curl.cainfo = "C:\Windows\cacert.pem"
Run Code Online (Sandbox Code Playgroud)
然而,即使多次重启我的服务器并更改路径,我也会收到相同的错误消息.
我使用Apache模块中的WAMP并启用了ssl_module.从PGP扩展我启用了php_curl.
仍然是相同的错误消息.为什么会这样?
现在我正在关注此修复程序:如何修复PHP CURL错误60 SSL
这表明我将这些行添加到我的cURL选项中:
curl_setopt($process, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
curl_setopt($process, CURLOPT_SSL_VERIFYPEER, true);
Run Code Online (Sandbox Code Playgroud)
我在哪里添加选项到我的cURL?显然不是通过命令行,因为我的CLI没有找到命令"curl_setopt"
编辑
这是我正在运行的代码:
public function chargeStripe()
{
$stripe = new Stripe;
$stripe = Stripe::make(env('STRIPE_PUBLIC_KEY'));
$charge = $stripe->charges()->create([
'amount' => 2900,
'customer' => Input::get('stripeEmail'),
'currency' => 'EUR',
]);
dd($charge);
// echo $charge[Input::get('stripeToken')];
return Redirect::route('step1');
}
Run Code Online (Sandbox Code Playgroud) root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt
* About to connect() to {abc} port 21 (#0)
* Trying {abc}...
* Connected to {abc} ({abc}) port 21 (#0)
< 220-Cerberus FTP Server - Home Edition
< 220-This is the UNLICENSED Home Edition and may be used for home, personal use only
< 220-Welcome to Cerberus FTP Server
< 220 Created by Cerberus, LLC
> AUTH SSL
< 234 Authentication method accepted
* successfully set certificate verify locations:
* CAfile: …Run Code Online (Sandbox Code Playgroud) 我有一个返回JSON对象的URL,如下所示:
{
"expires_in":5180976,
"access_token":"AQXzQgKTpTSjs-qiBh30aMgm3_Kb53oIf-VA733BpAogVE5jpz3jujU65WJ1XXSvVm1xr2LslGLLCWTNV5Kd_8J1YUx26axkt1E-vsOdvUAgMFH1VJwtclAXdaxRxk5UtmCWeISB6rx6NtvDt7yohnaarpBJjHWMsWYtpNn6nD87n0syud0"
}
Run Code Online (Sandbox Code Playgroud)
我想得到access_token价值.那我怎么能通过PHP检索呢?
虽然尝试在Windows上设置php环境(使用wamp)来使用Amazon PHP SDK,但当我尝试运行示例测试时,我收到以下错误:
Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL resource: Resource id #10; cURL error: SSL certificate problem: unable to get local issuer certificate (cURL error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in C:\wamp\www\AWSSDKforPHP\lib\requestcore\requestcore.class.php on line 848
Run Code Online (Sandbox Code Playgroud)
我已经将以下行添加到我的php.ini中
curl.cainfo = C:\Windows\ca-bundle.crt
Run Code Online (Sandbox Code Playgroud)
这是我使用此VBS脚本VBS脚本创建的证书的位置
我也重启了我的WAMP服务.

我最近得到了一台新的Windows计算机,并安装了php symfony框架.
尝试使用新命令时,C:> php symfony new blog我收到错误消息[GuzzleHttp\Ring\Exception\RingException] cURL error 60: SSL certificate problem: unable to get local issuer certificate.
由于我对CMD界面不太熟悉,所以在这个例子中我该怎么做我一无所知.
我需要知道这是一个错误的窗口或symfony本身和我可以采取任何可能的路线来修复它.
我试图使用php和curl库下载安全(使用https)网页的内容.
但是,读取失败,我收到错误60:"SSL证书问题,验证CA证书是否正常."
还有"详细信息:SSL3_GET_SERVER_CERTIFICATE:证书验证失败"
所以...非常自我解释的错误消息.
我的问题是:如何发送SSL证书(正确的?)并获取此页面进行验证并让我进入?
另外,这是我的选项数组,以防你想知道:
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after …Run Code Online (Sandbox Code Playgroud) 尝试使用YouTube API v3获取一些视频信息,使用服务描述符在Symfony2中使用Guzzle.
当我运行脚本时,我得到了这个:
[curl] 60:SSL证书问题:无法获得本地发行人证书[url] https://www.googleapis.com/youtube/v3/videos?id=2xbVbCoHBgA&part=snippet&key= {MY_KEY}
500内部服务器错误 - CurlException
我的描述符看起来像这样:
{
"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
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是在本地Ubuntu 14.04开发环境中运行的,其中包含一个非常基本的LAMP堆栈.
关于可能导致这种情况的任何想法?
我一直在使用cURL来验证几个月的登录,并且它一直运行良好.
$searchURL = "https://url.com/isTokenValid?";
$strCookie = 'asdf=' . $_COOKIE['asdf'] . '; path=/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $searchURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_COOKIE, $strCookie );
curl_setopt($ch, CURLOPT_CAPATH, "\cacert.pem");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, FALSE);
if($answer = curl_exec($ch))
{
if (strpos($answer,'true') !== false)
{
$login = true;
}
else
{
$login = false;
}
Run Code Online (Sandbox Code Playgroud)
今天早上 - 它停止工作,我收到错误:
卷曲错误:SSL证书问题:无法获取本地颁发者证书
我正在使用cacert.pem来自https://curl.haxx.se/ca/cacert.pem的文件- 如果需要以某种方式更新或刷新此数据,我正在使用此日期的文件,这似乎仍然是最新的:
来自Mozilla的证书数据:2015年10月28日星期三04:12:04
这不是我在网络开发方面的强项,所以我不确定如何解决这里发生的事情.我的第一个想法是它必须是服务器端的东西,因为我周末没有在本地进行任何更改,但我不想开始戳,如果有人能指出我正确的方向.
谢谢!
我想在 PHP 7.3.90 中发出 curl 请求
curl -V
curl 7.64.0 (x86_64-pc-linux-gnu) libcurl/7.64.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.36.0 librtmp/2.3
Release-Date: 2019-02-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
Run Code Online (Sandbox Code Playgroud)
$ch = curl_init();
// 2. set the options, including the url
curl_setopt($ch, CURLOPT_URL, "https://mydomain/get-token");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("App-Key: …Run Code Online (Sandbox Code Playgroud)