【发布时间】:2017-08-16 22:04:29
【问题描述】:
我正在尝试在我的应用程序中付款(前端为 Laravel 5.4 + Vue),但 stripe 不断返回此错误:
(1/1) HttpException
Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
问题是,如果我转到支持页面并复制并粘贴脚本以检查我的 TLS 版本:
<?php
// Include stripe-php as you usually do, either with composer as shown,
// or with a direct require, as commented out.
require_once("vendor/autoload.php");
// require_once("/path/to/stripe-php/init.php");
\Stripe\Stripe::setApiKey("sk_test_BQokikJOvBiI2HlWgH4olfQ2");
\Stripe\Stripe::$apiBase = "https://api-tls12.stripe.com";
try {
\Stripe\Charge::all();
echo "TLS 1.2 supported, no action required.";
} catch (\Stripe\Error\ApiConnection $e) {
echo "TLS 1.2 is not supported. You will need to upgrade your integration.";
}
?>
我收到“支持 TLS 1.2,无需任何操作。”。最重要的是,一周前 api 可以正常工作,在线版本仍然可以正常工作,但在本地却不行。
我错过了什么?
【问题讨论】:
-
对于你的应用程序,而不是测试,你这里使用的是官方的 Stripe lib,还是 Laravel 自带的包?您的 Laravel 应用程序是否在与普通 php 安装不同的环境中运行?如果您从应用程序中向
https://www.howsmyssl.com/a/check发出请求,结果是什么 --- TLS 1.0 还是 1.2?