Skip to content

Commit b952234

Browse files
committed
Update certificates and make pinning optional
1 parent f55585b commit b952234

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

library/src/main/kotlin/me/proxer/library/ProxerApi.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,12 @@ class ProxerApi private constructor(retrofit: Retrofit) {
6363
const val TEST_KEY = "test"
6464

6565
private val CERTIFICATES = arrayOf(
66-
// https://censys.io/certificates/0687260331a72403d909f105e69bcf0d32e1bd2493ffc6d9206d11bcd6770739
6766
"sha256/Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=",
68-
// https://censys.io/certificates/16af57a9f676b0ab126095aa5ebadef22ab31119d644ac95cd4b93dbf3f26aeb
6967
"sha256/Y9mvm0exBk1JoQ57f9Vm28jKo5lFm/woKcVxrYxu80o=",
70-
// https://censys.io/certificates/1793927a0614549789adce2f8f34f7f0b66d0f3ae3a3b84d21ec15dbba4fadc7
7168
"sha256/58qRu/uxh4gFezqAcERupSkRYBlBAvfcw7mEjGPLnNU=",
72-
// https://censys.io/certificates/52f0e1c4e58ec629291b60317f074671b85d7ea80d5b07273463534b32b40234
7369
"sha256/grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=",
74-
// https://censys.io/certificates/96bcec06264976f37460779acf28c5a7cfe8a3c0aae11a8ffcee05c0bddf08c6
75-
"sha256/C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M="
70+
"sha256/C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=",
71+
"sha256/TeT9kTnquzkcIJC0caQ09mL9o/Fj6GqUPJ5IQQ/ztUM=",
7672
)
7773

7874
private const val DEFAULT_USER_AGENT = "ProxerLibJava/" + BuildConfig.VERSION
@@ -182,6 +178,7 @@ class ProxerApi private constructor(retrofit: Retrofit) {
182178
private var moshi: Moshi? = null
183179
private var client: OkHttpClient? = null
184180
private var retrofit: Retrofit? = null
181+
private var enableCertificatePinning: Boolean = false
185182
private var enableRateLimitProtection: Boolean = false
186183

187184
/**
@@ -263,7 +260,7 @@ class ProxerApi private constructor(retrofit: Retrofit) {
263260
if (enableRateLimitProtection) add(4, RateLimitInterceptor(moshi, client?.cache))
264261
}
265262

266-
certificatePinner(constructCertificatePinner())
263+
if (enableCertificatePinning) certificatePinner(constructCertificatePinner())
267264
}
268265
.build()
269266
}

0 commit comments

Comments
 (0)