stripe-php: TLS 1.2 not working with v3 but works with v2

Having an issue where “stripe/stripe-php”: “2." works with TLS1.2 but “stripe/stripe-php”: "3.” does not.

When using stripe 2.* it works, returns TLS 1.2 supported, no action required. When using stripe 3.* it does not work, returns TLS 1.2 is not supported. You will need to upgrade your integration.

We verified that our server supports TLS1.2 properly.
We used composer to install the Stripe library.

{
  "require": {
    "stripe/stripe-php": "2.*"
  }
}

Used the php code below to test that TLS1.2 is working properly.

<?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("StripeLibrary/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.";
}
?>

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@drafie Great. Thank-you! I’ll let you know when we come up with something.