Skip to content

Commit 8533a5d

Browse files
committed
Simplify certificate retrieval
1 parent 3e897ca commit 8533a5d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,8 @@ class CustomCertManagerTest {
8282
try {
8383
conn.connectTimeout = 5000
8484
conn.readTimeout = 5000
85-
conn.inputStream.use { stream ->
86-
stream.read()
87-
val certs = mutableListOf<X509Certificate>()
88-
conn.serverCertificates.forEach { certs += it as X509Certificate }
89-
return certs
85+
conn.inputStream.use {
86+
return conn.serverCertificates.filterIsInstance<X509Certificate>()
9087
}
9188
} finally {
9289
conn.disconnect()

0 commit comments

Comments
 (0)