简体   繁体   中英

Issue requests from local Google App Engine devserver with TLSv1.2

I'm running an AppEngine on Java 1.7, using the Spring framework. I need to do request to the Stripe API , which requires TLSv1.2 when doing a request. This works fine when deploying the application to the Google environment, but it refuses to use this protocol when running the server locally. It gives the following error:

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 .

I'm using IntelliJ, AppEngine SDK version 1.9.42 in combination with Maven. I've tried adding build options in multiple places (-Ddeployment.security.TLSv1.2=true -Dhttps.protocols=TLSv1.2), in the IntelliJ Run/Debug configuration, in the XML JVM flags, in the dev_appserver.py file, but none of them worked. How can I enable TLSv1.2 in my Java 7 local development server, and talk to the Stripe API?

From the blog entry referenced in the error log:

You can proactively check whether your Stripe integration is ready, and how to upgrade, by following the steps on our TLS deprecation page .

And from that link which points to How do I upgrade my Stripe integration from TLS 1.0 to TLS 1.2? you can find the Java-specific instructions :

You can determine whether your Java integration is affected from the Java version you are running, and the stripe-java version you are using.

You can find your Java version by running java -version at the command line, and your stripe-java version by looking for the version number in your jar file's name, for example stripe-java-1.40.0.jar or by finding the version of the Stripe dependency in your POM file.

If you are running Java

  • version 1.6, you will need to upgrade to at least Java version 1.7, and stripe-java version 1.36.0.
  • version 1.7, and you have a stripe-java version earlier than 1.36.0, you will need to upgrade to at least stripe-java version 1.36.0.
  • version 1.8, you will not need to change anything.

You can upgrade your stripe-java version by downloading a new jar , or by upgrading the version number in your POM, and rebuilding your project.

You can upgrade your Java version by downloading a new copy , or installing a newer version of OpenJDK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM