Php Symfony2&;PayPal-cURL错误:14077410:SSL(sslv3警报握手失败)
我正在尝试连接到Paypal的沙盒服务器。为此,我使用JMSPaymentCoreBundle和JMSPaypalCoreBundle 但当我尝试连接时,会引发异常:Php Symfony2&;PayPal-cURL错误:14077410:SSL(sslv3警报握手失败),php,symfony,ssl,curl,paypal,Php,Symfony,Ssl,Curl,Paypal,我正在尝试连接到Paypal的沙盒服务器。为此,我使用JMSPaymentCoreBundle和JMSPaypalCoreBundle 但当我尝试连接时,会引发异常:错误:14077410:SSL例程:SSL23\u GET\u SERVER\u HELLO:sslv3警报握手失败 我的Symfony版本是2.7.9。我的curl版本是7.43.0,OpenSSL版本是1.0.2f 我在互联网上寻找了答案,现在看来,为了使用PayPal沙箱,我请求使用TLS1.2。所以我补充说: curl\u
错误:14077410:SSL例程:SSL23\u GET\u SERVER\u HELLO:sslv3警报握手失败
我的Symfony版本是2.7.9。我的curl版本是7.43.0,OpenSSL版本是1.0.2f
我在互联网上寻找了答案,现在看来,为了使用PayPal沙箱,我请求使用TLS1.2。所以我补充说:
curl\u setopt($curl,CURLOPT\u SSLVERSION,6)代码>(即TLS 1.2)
在vendor/jms/payment-paypal-bundle/jms/payment/PaypalBundle/Client/Client.php
public function request(Request $request)
{
if (!extension_loaded('curl')) {
throw new \RuntimeException('The cURL extension must be loaded.');
}
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt_array($curl, $this->curlOptions);
curl_setopt($curl, CURLOPT_URL, $request->getUri());
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
// Try but did not worl: curl_setopt($curl, CURLOPT_SSL_CIPHER_LIST, 'TLSv1');
curl_setopt($curl, CURLOPT_SSLVERSION,6); // What i also add but error with my SSL protocol version not supported
etc.
但现在我遇到了以下错误:cURL错误:不支持的SSL协议版本
谢谢你的帮助!(为我的英语感到抱歉)
编辑:所以错误似乎来自以下部分
在我的控制器中:
$instruction = $reservation->getPaymentInstruction();
if (null === $pendingTransaction = $instruction->getPendingTransaction()) {
$payment = $this->ppc->createPayment($instruction->getId(), $instruction->getAmount() - $instruction->getDepositedAmount());
} else {
$payment = $pendingTransaction->getPayment();
}
$result = $this->ppc->approveAndDeposit($payment->getId(), $payment->getTargetAmount());
if (Result::STATUS_PENDING === $result->getStatus()) {
$ex = $result->getPluginException();
if ($ex instanceof ActionRequiredException) {
$action = $ex->getAction();
if ($action instanceof VisitUrl) {
return $this->redirect($action->getUrl());
}
throw $ex;
}
} else if (Result::STATUS_SUCCESS !== $result->getStatus()) {
throw new \RuntimeException('Transaction was not successful: '.$result->getReasonCode());
}
在我的供应商中:(vendor/jms/payment-paypal-bundle/jms/payment/PaypalBundle/Client/Client.php
)
当我添加curl\u setopt($curl,CURLOPT\u SSLVERSION,6)
及
您是否正在针对PayPal沙盒API端点进行测试?
PayPal昨晚升级了他们的沙盒API端点,要求TLS 1.2并提供(仅)SHA256签名证书
更多细节在这里和这里
听上去,您可能正在尝试实施TLS1.2以外的内容(很可能),或者您的openssl LIB太旧了,不支持TLS1.2(低于openssl 1.0.1c的任何内容,都不太可能)
您可能想尝试从SDK运行TlsCheck.php谢谢!我会调查的!只是,我想你忘了链接了?你能在你的代码中的什么地方发布你遇到的问题吗?