We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8d4f9a commit 9f59985Copy full SHA for 9f59985
lib/src/test/java/at/bitfire/cert4android/CustomCertManagerTest.kt
@@ -114,10 +114,12 @@ class CustomCertManagerTest {
114
SecureRandom()
115
)
116
}.socketFactory
117
- conn.inputStream.read()
118
- val certs = mutableListOf<X509Certificate>()
119
- conn.serverCertificates.forEach { certs += it as X509Certificate }
120
- return certs
+ conn.inputStream.use {
+ it.read()
+ val certs = mutableListOf<X509Certificate>()
+ conn.serverCertificates.forEach { certs += it as X509Certificate }
121
+ return certs
122
+ }
123
} finally {
124
conn.disconnect()
125
}
0 commit comments