-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GAE changes: SDK 1.4.0 support, increase timeout to 55 seconds.
- Loading branch information
Showing
5 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.5 | ||
1.0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,9 +251,22 @@ private static StripeResponse makeAppEngineRequest(RequestMethod method, | |
Object httpMethod = requestMethodClass.getDeclaredField(method.name()).get(null); | ||
|
||
Class<?> fetchOptionsBuilderClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions$Builder"); | ||
Object fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("validateCertificate").invoke(null); | ||
Object fetchOptions = null; | ||
try { | ||
fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("validateCertificate").invoke(null); | ||
} catch (NoSuchMethodException e) { | ||
System.err.println("Warning: this App Engine SDK version does not allow verification of SSL certificates;" + | ||
"this exposes you to a MITM attack. Please upgrade your App Engine SDK to >=1.5.0. " + | ||
"If you have questions, contact [email protected]."); | ||
fetchOptions = fetchOptionsBuilderClass.getDeclaredMethod("withDefaults").invoke(null); | ||
} | ||
|
||
|
||
Class<?> fetchOptionsClass = Class.forName("com.google.appengine.api.urlfetch.FetchOptions"); | ||
|
||
// GAE requests can time out after 60 seconds, so make sure we leave | ||
// some time for the application to handle a slow Stripe | ||
fetchOptionsClass.getDeclaredMethod("setDeadline", java.lang.Double.class).invoke(fetchOptions, new Double(55)); | ||
|
||
Class<?> requestClass = Class.forName("com.google.appengine.api.urlfetch.HTTPRequest"); | ||
|
||
|