Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83ba9b50 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Handle InterruptedException

parent ec33076b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ class CustomCertManager: X509TrustManager, Closeable {
    }


    @Throws(CertificateException::class)
    override fun checkClientTrusted(chain: Array<X509Certificate>?, authType: String?) {
        throw CertificateException("cert4android doesn't validate client certificates")
    }
@@ -146,6 +147,7 @@ class CustomCertManager: X509TrustManager, Closeable {
     * @param authType     authentication type (ignored)
     * @throws CertificateException in case of an untrusted or questionable certificate
     */
    @Throws(CertificateException::class)
    override fun checkServerTrusted(chain: Array<X509Certificate>, authType : String) {
        var trusted = false

@@ -187,7 +189,10 @@ class CustomCertManager: X509TrustManager, Closeable {
        val startTime = System.currentTimeMillis()
        synchronized(decisionLock) {
            while (System.currentTimeMillis() < startTime + SERVICE_TIMEOUT) {
                try {
                    decisionLock.wait(SERVICE_TIMEOUT)
                } catch(e: InterruptedException) {
                }
                val decision = decisions.get(id)
                if (decision != null) {
                    decisions.delete(id)