Skip to content

Commit 203925d

Browse files
committed
Add timeouts
1 parent 3d73f87 commit 203925d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/src/test/java/at/bitfire/cert4android/CustomCertManagerTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class CustomCertManagerTest {
100100
fun getSiteCertificates(url: URL): List<X509Certificate> {
101101
val conn = url.openConnection() as HttpsURLConnection
102102
try {
103+
conn.connectTimeout = 5000
104+
conn.readTimeout = 5000
103105
conn.hostnameVerifier = HostnameVerifier { _, _ -> true }
104106
conn.sslSocketFactory = SSLContext.getInstance("TLS").apply {
105107
init(

0 commit comments

Comments
 (0)