Skip to content

Commit

Permalink
Remove StripeSSLSocketFactory (#2599)
Browse files Browse the repository at this point in the history
Motivation
The Stripe API requires TLS 1.2 [0].
Android API 20+ have TLS 1.2 enabled by default [1].

Now that `minSdkVersion` is `21`, `StripeSSLSocketFactory` is
no longer necessary.

[0] https://stripe.com/blog/completing-tls-upgrade
[1] https://developer.android.com/reference/javax/net/ssl/SSLSocket#default-configuration-for-different-android-versions

Testing
Verifiy on API 21 device
  • Loading branch information
mshafrir-stripe authored Jun 18, 2020
1 parent d360344 commit ed99a5a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 140 deletions.
2 changes: 0 additions & 2 deletions stripe/src/main/java/com/stripe/android/ConnectionFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ internal interface ConnectionFactory {
connectTimeout = CONNECT_TIMEOUT
readTimeout = READ_TIMEOUT
useCaches = false
sslSocketFactory = SSL_SOCKET_FACTORY
requestMethod = request.method.code

request.headers.forEach { (key, value) ->
Expand All @@ -41,7 +40,6 @@ internal interface ConnectionFactory {
}

private companion object {
private val SSL_SOCKET_FACTORY = StripeSSLSocketFactory()
private val CONNECT_TIMEOUT = TimeUnit.SECONDS.toMillis(30).toInt()
private val READ_TIMEOUT = TimeUnit.SECONDS.toMillis(80).toInt()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal class StripePaymentController internal constructor(
private val config: PaymentAuthConfig =
PaymentAuthConfig.get(),
private val threeDs2Service: StripeThreeDs2Service =
StripeThreeDs2ServiceImpl(context, StripeSSLSocketFactory(), enableLogging),
StripeThreeDs2ServiceImpl(context, null, enableLogging),
private val analyticsRequestExecutor: AnalyticsRequestExecutor =
AnalyticsRequestExecutor.Default(Logger.getInstance(enableLogging)),
private val analyticsDataFactory: AnalyticsDataFactory =
Expand Down
104 changes: 0 additions & 104 deletions stripe/src/main/java/com/stripe/android/StripeSSLSocketFactory.kt

This file was deleted.

This file was deleted.

0 comments on commit ed99a5a

Please sign in to comment.