File tree Expand file tree Collapse file tree 1 file changed +0
-17
lines changed
lib/src/test/java/at/bitfire/cert4android Expand file tree Collapse file tree 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,9 @@ import org.junit.BeforeClass
1616import org.junit.Test
1717import java.io.IOException
1818import java.net.URL
19- import java.security.SecureRandom
2019import java.security.cert.CertificateException
2120import java.security.cert.X509Certificate
22- import javax.net.ssl.HostnameVerifier
2321import javax.net.ssl.HttpsURLConnection
24- import javax.net.ssl.SSLContext
25- import javax.net.ssl.TrustManager
26- import javax.net.ssl.X509TrustManager
2722
2823class CustomCertManagerTest {
2924
@@ -101,18 +96,6 @@ class CustomCertManagerTest {
10196 try {
10297 conn.connectTimeout = 5000
10398 conn.readTimeout = 5000
104- conn.hostnameVerifier = HostnameVerifier { _, _ -> true }
105- conn.sslSocketFactory = SSLContext .getInstance(" TLS" ).apply {
106- init (
107- null ,
108- arrayOf<TrustManager >(object : X509TrustManager {
109- override fun checkClientTrusted (chain : Array <out X509Certificate >? , authType : String? ) {}
110- override fun checkServerTrusted (chain : Array <out X509Certificate >? , authType : String? ) {}
111- override fun getAcceptedIssuers (): Array <X509Certificate > = emptyArray()
112- }),
113- SecureRandom ()
114- )
115- }.socketFactory
11699 conn.inputStream.use { stream ->
117100 stream.read()
118101 val certs = mutableListOf<X509Certificate >()
You can’t perform that action at this time.
0 commit comments