import typing

import java
import java.chaquopy
import java.lang
import java.net
import java.security
import java.security.cert
import javax.net.ssl
import org.apache.http.conn.scheme
import org.apache.http.params

class AbstractVerifier(X509HostnameVerifier):
    def __init__(self) -> None: ...
    @staticmethod
    def acceptableCountryWildcard(cn: str | java.lang.String, /) -> bool: ...
    @staticmethod
    def countDots(s: str | java.lang.String, /) -> int: ...
    @staticmethod
    def getCNs(cert: java.security.cert.X509Certificate, /) -> java.chaquopy.JavaArray[java.lang.String]: ...
    @staticmethod
    def getDNSSubjectAlts(cert: java.security.cert.X509Certificate, /) -> java.chaquopy.JavaArray[java.lang.String]: ...
    @typing.overload
    def verify(self, host: str | java.lang.String, cert: java.security.cert.X509Certificate, /) -> None: ...
    @typing.overload
    def verify(self, host: str | java.lang.String, session: javax.net.ssl.SSLSession, /) -> bool: ...
    @typing.overload
    def verify(self, host: str | java.lang.String, ssl: javax.net.ssl.SSLSocket, /) -> None: ...
    @typing.overload
    def verify(self, host: str | java.lang.String, cns: java.chaquopy.JavaArray[java.lang.String], subjectAlts: java.chaquopy.JavaArray[java.lang.String], strictWithSubDomains: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

class AllowAllHostnameVerifier(AbstractVerifier):
    def __init__(self) -> None: ...
    def toString(self) -> str: ...
    def verify(self, host: str | java.lang.String, cns: java.chaquopy.JavaArray[java.lang.String], subjectAlts: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...

class BrowserCompatHostnameVerifier(AbstractVerifier):
    def __init__(self) -> None: ...
    def toString(self) -> str: ...
    def verify(self, host: str | java.lang.String, cns: java.chaquopy.JavaArray[java.lang.String], subjectAlts: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...

class SSLSocketFactory(org.apache.http.conn.scheme.LayeredSocketFactory):
    ALLOW_ALL_HOSTNAME_VERIFIER: typing.ClassVar[X509HostnameVerifier] = ...
    BROWSER_COMPATIBLE_HOSTNAME_VERIFIER: typing.ClassVar[X509HostnameVerifier] = ...
    SSL: typing.ClassVar[str] = ...
    SSLV2: typing.ClassVar[str] = ...
    STRICT_HOSTNAME_VERIFIER: typing.ClassVar[X509HostnameVerifier] = ...
    TLS: typing.ClassVar[str] = ...
    @typing.overload
    def __init__(self, truststore: java.security.KeyStore, /) -> None: ...
    @typing.overload
    def __init__(self, keystore: java.security.KeyStore, keystorePassword: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, keystore: java.security.KeyStore, keystorePassword: str | java.lang.String, truststore: java.security.KeyStore, /) -> None: ...
    @typing.overload
    def __init__(self, algorithm: str | java.lang.String, keystore: java.security.KeyStore, keystorePassword: str | java.lang.String, truststore: java.security.KeyStore, random: java.security.SecureRandom, nameResolver: org.apache.http.conn.scheme.HostNameResolver, /) -> None: ...
    def connectSocket(self, sock: java.net.Socket, host: str | java.lang.String, port: int | java.jint | java.lang.Integer, localAddress: java.net.InetAddress, localPort: int | java.jint | java.lang.Integer, params: org.apache.http.params.HttpParams, /) -> java.net.Socket: ...
    @typing.overload
    def createSocket(self) -> java.net.Socket: ...
    @typing.overload
    def createSocket(self, socket: java.net.Socket, host: str | java.lang.String, port: int | java.jint | java.lang.Integer, autoClose: bool | java.jboolean | java.lang.Boolean, /) -> java.net.Socket: ...
    def getHostnameVerifier(self) -> X509HostnameVerifier: ...
    @staticmethod
    def getSocketFactory() -> SSLSocketFactory: ...
    def isSecure(self, sock: java.net.Socket, /) -> bool: ...
    def setHostnameVerifier(self, hostnameVerifier: X509HostnameVerifier, /) -> None: ...

class StrictHostnameVerifier(AbstractVerifier):
    def __init__(self) -> None: ...
    def toString(self) -> str: ...
    def verify(self, host: str | java.lang.String, cns: java.chaquopy.JavaArray[java.lang.String], subjectAlts: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...

class X509HostnameVerifier(javax.net.ssl.HostnameVerifier):
    @typing.overload
    def verify(self, arg1: str | java.lang.String, arg2: java.security.cert.X509Certificate, /) -> None: ...
    @typing.overload
    def verify(self, arg1: str | java.lang.String, arg2: javax.net.ssl.SSLSession, /) -> bool: ...
    @typing.overload
    def verify(self, arg1: str | java.lang.String, arg2: javax.net.ssl.SSLSocket, /) -> None: ...
    @typing.overload
    def verify(self, arg1: str | java.lang.String, arg2: java.chaquopy.JavaArray[java.lang.String], arg3: java.chaquopy.JavaArray[java.lang.String], /) -> None: ...
