Skip to content

Commit 9679f8c

Browse files
committed
Set OkHttp protocols to TLSv1.2 and TLSv1.3 only
1 parent 8cb6560 commit 9679f8c

File tree

2 files changed

+5
-93
lines changed

2 files changed

+5
-93
lines changed

src/main/java/org/quantumbadger/redreader/http/LegacyTLSSocketFactory.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

src/main/java/org/quantumbadger/redreader/http/okhttp/OKHTTPBackend.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.util.Log
2222
import okhttp3.CacheControl
2323
import okhttp3.Call
2424
import okhttp3.ConnectionPool
25+
import okhttp3.ConnectionSpec
2526
import okhttp3.Cookie
2627
import okhttp3.CookieJar
2728
import okhttp3.HttpUrl
@@ -102,6 +103,10 @@ class OKHTTPBackend private constructor() : HTTPBackend() {
102103
builder.proxy(tor)
103104
}
104105

106+
// This restrict the client to only use TLSv1.2 and TLSv1.3
107+
// In other word, only modern website with HTTPS enabled
108+
builder.connectionSpecs(listOf(ConnectionSpec.RESTRICTED_TLS))
109+
105110
builder.followRedirects(true)
106111
builder.followSslRedirects(true)
107112

0 commit comments

Comments
 (0)