2017-08-16 71 views
1

我想付款在我的應用程序(Laravel 5.4 + Vue公司在前端)的正確版本,但條紋一直返回此錯誤:條紋API引發TLS錯誤甚至TLS

(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在沒有任何問題的情況下工作,並且在線版本仍在運行,但在本地它不是。

我錯過了什麼?

+0

爲您的應用,而不是測試,你在這裏使用的是官方條紋lib下,或Laravel附帶的軟件包?您的Laravel應用程序是否在與股票php安裝不同的環境中運行?如果您從您的應用程序中向https:// www.howsmyssl.com/a/check'發出請求,結果是什麼?TLS 1.0或1.2? – duck

回答

1

this,它應該工作,如果你的條紋PHP版本比3.19.0更大:

If you receive the message 「TLS 1.2 is supported」, no changes need to be made. If not, check which version of our PHP library you are using. If it’s below 3.19.0, update it and try again. Otherwise, continue with these additional steps.

+0

它應該但它不:( – ste