SSL证书错误无法获取本地颁发者证书 [英] SSL certificate error unable to get local issuer certificate
问题描述
此错误仅在我的网络服务器上显示。我使用更新的cacert.pem并在我的本地主机服务器中的 php.ini
文件中引用它。
我的问题是如何在一个典型的Web服务器上做到这一点? (通过我的意思是通过 php.ini
)引用 cacert.pem
)
或者,有一种方法,我可以在我的函数或 Mailchimps API函数中定义它,我使用它通过 composer
>我目前的功能:
bootstrap.php
require_once __DIR__。 '\..\..\lib\Cake\Network\Http\HttpSocket.php';
控制器:
////////////////////////// MAILCHIMP /////////// ////////////
$ Socket = new HttpSocket(array('ssl_cafile'=> CAKE。'Config'。DS。'cacert.pem',));
$ api_key =xxxxxxxxxxxxxxxxxxxxxxxx;
$ list_id =xxxxxxxxx;
$ merge_vars = array('FNAME'=> $ this-> request-> data ['Subscriber'] ['first_name'],'LNAME'=> $ this-> ; request-> data ['Subscriber'] ['last_name']);
$ Mailchimp = new Mailchimp($ api_key);
$ Mailchimp_Lists = new Mailchimp_Lists($ Mailchimp);
$ subscribers = $ Mailchimp_Lists-> subscribe($ list_id,array('email'=> $ this-> request-> data ['Subscriber'] ['email']),$ merge_vars) ;
//////////////////////////////////////////////// ///////////////
在与一些朋友交谈后,我发现我的网络服务器主机运行cPanel,它有一个简单的SSL证书安装程序。
我无法评论提供的其他答案由Rasclatt作为我did not试试。但是它听起来很全面。
对于有这个问题的人 - 检查您的主机是否运行cPanel软件 - 它只需点击几下。
This error is only present on my webserver online. I am using a updated cacert.pem and referencing it in my php.ini
file in my localhost server.
My question is how this could be done on a typical web server? (by how I mean referencing the cacert.pem
via the php.ini
)
Alternatively is there a way I can define it within my function or Mailchimps API function that i am using which was installed via composer?
My current function:
bootstrap.php
require_once __DIR__ . '\..\..\lib\Cake\Network\Http\HttpSocket.php';
Controller:
//////////////////////////MAILCHIMP///////////////////////
$Socket = new HttpSocket(array('ssl_cafile' => CAKE . 'Config' . DS . 'cacert.pem', ));
$api_key = "xxxxxxxxxxxxxxxxxxxxxxxx";
$list_id = "xxxxxxxxx";
$merge_vars = array('FNAME'=>$this->request->data['Subscriber']['first_name'], 'LNAME'=>$this->request->data['Subscriber']['last_name']);
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
$subscriber = $Mailchimp_Lists->subscribe($list_id, array('email' => $this->request->data['Subscriber']['email']), $merge_vars);
/////////////////////////////////////////////////////////////
After speaking to some friends i found out that my web server host runs cPanel which has a simple SSL certificate installer.
I cant comment on the other answer provided by Rasclatt as i didnt try it. However it sounds very comprehensive.
For those who have this issue - check if your hoster is running cPanel software - and its as simple as a few clicks.
这篇关于SSL证书错误无法获取本地颁发者证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!