We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Emscripten support emits an InsecureRequestWarning even when using HTTPS
This is a side-effect of us using JavaScript APIs instead of Python TLS and setting `is_verified` on the `EmscriptenHTTPConnection` so urllib3 is emitting an `InsecureRequestWarning` for every request, even ones that are using HTTPS.

* Set the proper value of `is_verified` depending on whether the request is HTTP or HTTPS.
* Add a test case that asserts that an `InsecureRequestWarning` is emitted for HTTP and isn't emitted for HTTPS.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/urllib3/contrib/emscripten/connection.py`
Content:
```
1 from __future__ import annotations
2 
3 import os
4 import typing
5 
6 # use http.client.HTTPException for consistency with non-emscripten
7 from http.client import HTTPException as HTTPException  # noqa: F401
8 from http.client import ResponseNotReady
9 
10 from ..._base_connection import _TYPE_BODY
11 from ...connection import HTTPConnection, ProxyConfig, port_by_scheme
12 from ...exceptions import TimeoutError
13 from ...response import BaseHTTPResponse
14 from ...util.connection import _TYPE_SOCKET_OPTIONS
15 from ...util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT
16 from ...util.url import Url
17 from .fetch import _RequestError, _TimeoutError, send_request, send_streaming_request
18 from .request import EmscriptenRequest
19 from .response import EmscriptenHttpResponseWrapper, EmscriptenResponse
20 
21 if typing.TYPE_CHECKING:
22     from ..._base_connection import BaseHTTPConnection, BaseHTTPSConnection
23 
24 
25 class EmscriptenHTTPConnection:
26     default_port: typing.ClassVar[int] = port_by_scheme["http"]
27     default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS]
28 
29     timeout: None | (float)
30 
31     host: str
32     port: int
33     blocksize: int
34     source_address: tuple[str, int] | None
35     socket_options: _TYPE_SOCKET_OPTIONS | None
36 
37     proxy: Url | None
38     proxy_config: ProxyConfig | None
39 
40     is_verified: bool = False
41     proxy_is_verified: bool | None = None
42 
43     _response: EmscriptenResponse | None
44 
45     def __init__(
46         self,
47         host: str,
48         port: int = 0,
49         *,
50         timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
51         source_address: tuple[str, int] | None = None,
52         blocksize: int = 8192,
53         socket_options: _TYPE_SOCKET_OPTIONS | None = None,
54         proxy: Url | None = None,
55         proxy_config: ProxyConfig | None = None,
56     ) -> None:
57         self.host = host
58         self.port = port
59         self.timeout = timeout if isinstance(timeout, float) else 0.0
60         self.scheme = "http"
61         self._closed = True
62         self._response = None
63         # ignore these things because we don't
64         # have control over that stuff
65         self.proxy = None
66         self.proxy_config = None
67         self.blocksize = blocksize
68         self.source_address = None
69         self.socket_options = None
70 
71     def set_tunnel(
72         self,
73         host: str,
74         port: int | None = 0,
75         headers: typing.Mapping[str, str] | None = None,
76         scheme: str = "http",
77     ) -> None:
78         pass
79 
80     def connect(self) -> None:
81         pass
82 
83     def request(
84         self,
85         method: str,
86         url: str,
87         body: _TYPE_BODY | None = None,
88         headers: typing.Mapping[str, str] | None = None,
89         # We know *at least* botocore is depending on the order of the
90         # first 3 parameters so to be safe we only mark the later ones
91         # as keyword-only to ensure we have space to extend.
92         *,
93         chunked: bool = False,
94         preload_content: bool = True,
95         decode_content: bool = True,
96         enforce_content_length: bool = True,
97     ) -> None:
98         self._closed = False
99         if url.startswith("/"):
100             # no scheme / host / port included, make a full url
101             url = f"{self.scheme}://{self.host}:{self.port}" + url
102         request = EmscriptenRequest(
103             url=url,
104             method=method,
105             timeout=self.timeout if self.timeout else 0,
106             decode_content=decode_content,
107         )
108         request.set_body(body)
109         if headers:
110             for k, v in headers.items():
111                 request.set_header(k, v)
112         self._response = None
113         try:
114             if not preload_content:
115                 self._response = send_streaming_request(request)
116             if self._response is None:
117                 self._response = send_request(request)
118         except _TimeoutError as e:
119             raise TimeoutError(e.message) from e
120         except _RequestError as e:
121             raise HTTPException(e.message) from e
122 
123     def getresponse(self) -> BaseHTTPResponse:
124         if self._response is not None:
125             return EmscriptenHttpResponseWrapper(
126                 internal_response=self._response,
127                 url=self._response.request.url,
128                 connection=self,
129             )
130         else:
131             raise ResponseNotReady()
132 
133     def close(self) -> None:
134         self._closed = True
135         self._response = None
136 
137     @property
138     def is_closed(self) -> bool:
139         """Whether the connection either is brand new or has been previously closed.
140         If this property is True then both ``is_connected`` and ``has_connected_to_proxy``
141         properties must be False.
142         """
143         return self._closed
144 
145     @property
146     def is_connected(self) -> bool:
147         """Whether the connection is actively connected to any origin (proxy or target)"""
148         return True
149 
150     @property
151     def has_connected_to_proxy(self) -> bool:
152         """Whether the connection has successfully connected to its proxy.
153         This returns False if no proxy is in use. Used to determine whether
154         errors are coming from the proxy layer or from tunnelling to the target origin.
155         """
156         return False
157 
158 
159 class EmscriptenHTTPSConnection(EmscriptenHTTPConnection):
160     default_port = port_by_scheme["https"]
161     # all this is basically ignored, as browser handles https
162     cert_reqs: int | str | None = None
163     ca_certs: str | None = None
164     ca_cert_dir: str | None = None
165     ca_cert_data: None | str | bytes = None
166     cert_file: str | None
167     key_file: str | None
168     key_password: str | None
169     ssl_context: typing.Any | None
170     ssl_version: int | str | None = None
171     ssl_minimum_version: int | None = None
172     ssl_maximum_version: int | None = None
173     assert_hostname: None | str | typing.Literal[False]
174     assert_fingerprint: str | None = None
175 
176     def __init__(
177         self,
178         host: str,
179         port: int = 0,
180         *,
181         timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,
182         source_address: tuple[str, int] | None = None,
183         blocksize: int = 16384,
184         socket_options: None
185         | _TYPE_SOCKET_OPTIONS = HTTPConnection.default_socket_options,
186         proxy: Url | None = None,
187         proxy_config: ProxyConfig | None = None,
188         cert_reqs: int | str | None = None,
189         assert_hostname: None | str | typing.Literal[False] = None,
190         assert_fingerprint: str | None = None,
191         server_hostname: str | None = None,
192         ssl_context: typing.Any | None = None,
193         ca_certs: str | None = None,
194         ca_cert_dir: str | None = None,
195         ca_cert_data: None | str | bytes = None,
196         ssl_minimum_version: int | None = None,
197         ssl_maximum_version: int | None = None,
198         ssl_version: int | str | None = None,  # Deprecated
199         cert_file: str | None = None,
200         key_file: str | None = None,
201         key_password: str | None = None,
202     ) -> None:
203         super().__init__(
204             host,
205             port=port,
206             timeout=timeout,
207             source_address=source_address,
208             blocksize=blocksize,
209             socket_options=socket_options,
210             proxy=proxy,
211             proxy_config=proxy_config,
212         )
213         self.scheme = "https"
214 
215         self.key_file = key_file
216         self.cert_file = cert_file
217         self.key_password = key_password
218         self.ssl_context = ssl_context
219         self.server_hostname = server_hostname
220         self.assert_hostname = assert_hostname
221         self.assert_fingerprint = assert_fingerprint
222         self.ssl_version = ssl_version
223         self.ssl_minimum_version = ssl_minimum_version
224         self.ssl_maximum_version = ssl_maximum_version
225         self.ca_certs = ca_certs and os.path.expanduser(ca_certs)
226         self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)
227         self.ca_cert_data = ca_cert_data
228 
229         self.cert_reqs = None
230 
231     def set_cert(
232         self,
233         key_file: str | None = None,
234         cert_file: str | None = None,
235         cert_reqs: int | str | None = None,
236         key_password: str | None = None,
237         ca_certs: str | None = None,
238         assert_hostname: None | str | typing.Literal[False] = None,
239         assert_fingerprint: str | None = None,
240         ca_cert_dir: str | None = None,
241         ca_cert_data: None | str | bytes = None,
242     ) -> None:
243         pass
244 
245 
246 # verify that this class implements BaseHTTP(s) connection correctly
247 if typing.TYPE_CHECKING:
248     _supports_http_protocol: BaseHTTPConnection = EmscriptenHTTPConnection("", 0)
249     _supports_https_protocol: BaseHTTPSConnection = EmscriptenHTTPSConnection("", 0)
250
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/urllib3/contrib/emscripten/connection.py b/src/urllib3/contrib/emscripten/connection.py
--- a/src/urllib3/contrib/emscripten/connection.py
+++ b/src/urllib3/contrib/emscripten/connection.py
@@ -67,6 +67,7 @@
         self.blocksize = blocksize
         self.source_address = None
         self.socket_options = None
+        self.is_verified = False
 
     def set_tunnel(
         self,
@@ -228,6 +229,10 @@
 
         self.cert_reqs = None
 
+        # The browser will automatically verify all requests.
+        # We have no control over that setting.
+        self.is_verified = True
+
     def set_cert(
         self,
         key_file: str | None = None,

{"golden_diff": "diff --git a/src/urllib3/contrib/emscripten/connection.py b/src/urllib3/contrib/emscripten/connection.py\n--- a/src/urllib3/contrib/emscripten/connection.py\n+++ b/src/urllib3/contrib/emscripten/connection.py\n@@ -67,6 +67,7 @@\n         self.blocksize = blocksize\n         self.source_address = None\n         self.socket_options = None\n+        self.is_verified = False\n \n     def set_tunnel(\n         self,\n@@ -228,6 +229,10 @@\n \n         self.cert_reqs = None\n \n+        # The browser will automatically verify all requests.\n+        # We have no control over that setting.\n+        self.is_verified = True\n+\n     def set_cert(\n         self,\n         key_file: str | None = None,\n", "issue": "Emscripten support emits an InsecureRequestWarning even when using HTTPS\nThis is a side-effect of us using JavaScript APIs instead of Python TLS and setting `is_verified` on the `EmscriptenHTTPConnection` so urllib3 is emitting an `InsecureRequestWarning` for every request, even ones that are using HTTPS.\r\n\r\n* Set the proper value of `is_verified` depending on whether the request is HTTP or HTTPS.\r\n* Add a test case that asserts that an `InsecureRequestWarning` is emitted for HTTP and isn't emitted for HTTPS.\r\n\n", "before_files": [{"content": "from __future__ import annotations\n\nimport os\nimport typing\n\n# use http.client.HTTPException for consistency with non-emscripten\nfrom http.client import HTTPException as HTTPException  # noqa: F401\nfrom http.client import ResponseNotReady\n\nfrom ..._base_connection import _TYPE_BODY\nfrom ...connection import HTTPConnection, ProxyConfig, port_by_scheme\nfrom ...exceptions import TimeoutError\nfrom ...response import BaseHTTPResponse\nfrom ...util.connection import _TYPE_SOCKET_OPTIONS\nfrom ...util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT\nfrom ...util.url import Url\nfrom .fetch import _RequestError, _TimeoutError, send_request, send_streaming_request\nfrom .request import EmscriptenRequest\nfrom .response import EmscriptenHttpResponseWrapper, EmscriptenResponse\n\nif typing.TYPE_CHECKING:\n    from ..._base_connection import BaseHTTPConnection, BaseHTTPSConnection\n\n\nclass EmscriptenHTTPConnection:\n    default_port: typing.ClassVar[int] = port_by_scheme[\"http\"]\n    default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS]\n\n    timeout: None | (float)\n\n    host: str\n    port: int\n    blocksize: int\n    source_address: tuple[str, int] | None\n    socket_options: _TYPE_SOCKET_OPTIONS | None\n\n    proxy: Url | None\n    proxy_config: ProxyConfig | None\n\n    is_verified: bool = False\n    proxy_is_verified: bool | None = None\n\n    _response: EmscriptenResponse | None\n\n    def __init__(\n        self,\n        host: str,\n        port: int = 0,\n        *,\n        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,\n        source_address: tuple[str, int] | None = None,\n        blocksize: int = 8192,\n        socket_options: _TYPE_SOCKET_OPTIONS | None = None,\n        proxy: Url | None = None,\n        proxy_config: ProxyConfig | None = None,\n    ) -> None:\n        self.host = host\n        self.port = port\n        self.timeout = timeout if isinstance(timeout, float) else 0.0\n        self.scheme = \"http\"\n        self._closed = True\n        self._response = None\n        # ignore these things because we don't\n        # have control over that stuff\n        self.proxy = None\n        self.proxy_config = None\n        self.blocksize = blocksize\n        self.source_address = None\n        self.socket_options = None\n\n    def set_tunnel(\n        self,\n        host: str,\n        port: int | None = 0,\n        headers: typing.Mapping[str, str] | None = None,\n        scheme: str = \"http\",\n    ) -> None:\n        pass\n\n    def connect(self) -> None:\n        pass\n\n    def request(\n        self,\n        method: str,\n        url: str,\n        body: _TYPE_BODY | None = None,\n        headers: typing.Mapping[str, str] | None = None,\n        # We know *at least* botocore is depending on the order of the\n        # first 3 parameters so to be safe we only mark the later ones\n        # as keyword-only to ensure we have space to extend.\n        *,\n        chunked: bool = False,\n        preload_content: bool = True,\n        decode_content: bool = True,\n        enforce_content_length: bool = True,\n    ) -> None:\n        self._closed = False\n        if url.startswith(\"/\"):\n            # no scheme / host / port included, make a full url\n            url = f\"{self.scheme}://{self.host}:{self.port}\" + url\n        request = EmscriptenRequest(\n            url=url,\n            method=method,\n            timeout=self.timeout if self.timeout else 0,\n            decode_content=decode_content,\n        )\n        request.set_body(body)\n        if headers:\n            for k, v in headers.items():\n                request.set_header(k, v)\n        self._response = None\n        try:\n            if not preload_content:\n                self._response = send_streaming_request(request)\n            if self._response is None:\n                self._response = send_request(request)\n        except _TimeoutError as e:\n            raise TimeoutError(e.message) from e\n        except _RequestError as e:\n            raise HTTPException(e.message) from e\n\n    def getresponse(self) -> BaseHTTPResponse:\n        if self._response is not None:\n            return EmscriptenHttpResponseWrapper(\n                internal_response=self._response,\n                url=self._response.request.url,\n                connection=self,\n            )\n        else:\n            raise ResponseNotReady()\n\n    def close(self) -> None:\n        self._closed = True\n        self._response = None\n\n    @property\n    def is_closed(self) -> bool:\n        \"\"\"Whether the connection either is brand new or has been previously closed.\n        If this property is True then both ``is_connected`` and ``has_connected_to_proxy``\n        properties must be False.\n        \"\"\"\n        return self._closed\n\n    @property\n    def is_connected(self) -> bool:\n        \"\"\"Whether the connection is actively connected to any origin (proxy or target)\"\"\"\n        return True\n\n    @property\n    def has_connected_to_proxy(self) -> bool:\n        \"\"\"Whether the connection has successfully connected to its proxy.\n        This returns False if no proxy is in use. Used to determine whether\n        errors are coming from the proxy layer or from tunnelling to the target origin.\n        \"\"\"\n        return False\n\n\nclass EmscriptenHTTPSConnection(EmscriptenHTTPConnection):\n    default_port = port_by_scheme[\"https\"]\n    # all this is basically ignored, as browser handles https\n    cert_reqs: int | str | None = None\n    ca_certs: str | None = None\n    ca_cert_dir: str | None = None\n    ca_cert_data: None | str | bytes = None\n    cert_file: str | None\n    key_file: str | None\n    key_password: str | None\n    ssl_context: typing.Any | None\n    ssl_version: int | str | None = None\n    ssl_minimum_version: int | None = None\n    ssl_maximum_version: int | None = None\n    assert_hostname: None | str | typing.Literal[False]\n    assert_fingerprint: str | None = None\n\n    def __init__(\n        self,\n        host: str,\n        port: int = 0,\n        *,\n        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,\n        source_address: tuple[str, int] | None = None,\n        blocksize: int = 16384,\n        socket_options: None\n        | _TYPE_SOCKET_OPTIONS = HTTPConnection.default_socket_options,\n        proxy: Url | None = None,\n        proxy_config: ProxyConfig | None = None,\n        cert_reqs: int | str | None = None,\n        assert_hostname: None | str | typing.Literal[False] = None,\n        assert_fingerprint: str | None = None,\n        server_hostname: str | None = None,\n        ssl_context: typing.Any | None = None,\n        ca_certs: str | None = None,\n        ca_cert_dir: str | None = None,\n        ca_cert_data: None | str | bytes = None,\n        ssl_minimum_version: int | None = None,\n        ssl_maximum_version: int | None = None,\n        ssl_version: int | str | None = None,  # Deprecated\n        cert_file: str | None = None,\n        key_file: str | None = None,\n        key_password: str | None = None,\n    ) -> None:\n        super().__init__(\n            host,\n            port=port,\n            timeout=timeout,\n            source_address=source_address,\n            blocksize=blocksize,\n            socket_options=socket_options,\n            proxy=proxy,\n            proxy_config=proxy_config,\n        )\n        self.scheme = \"https\"\n\n        self.key_file = key_file\n        self.cert_file = cert_file\n        self.key_password = key_password\n        self.ssl_context = ssl_context\n        self.server_hostname = server_hostname\n        self.assert_hostname = assert_hostname\n        self.assert_fingerprint = assert_fingerprint\n        self.ssl_version = ssl_version\n        self.ssl_minimum_version = ssl_minimum_version\n        self.ssl_maximum_version = ssl_maximum_version\n        self.ca_certs = ca_certs and os.path.expanduser(ca_certs)\n        self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)\n        self.ca_cert_data = ca_cert_data\n\n        self.cert_reqs = None\n\n    def set_cert(\n        self,\n        key_file: str | None = None,\n        cert_file: str | None = None,\n        cert_reqs: int | str | None = None,\n        key_password: str | None = None,\n        ca_certs: str | None = None,\n        assert_hostname: None | str | typing.Literal[False] = None,\n        assert_fingerprint: str | None = None,\n        ca_cert_dir: str | None = None,\n        ca_cert_data: None | str | bytes = None,\n    ) -> None:\n        pass\n\n\n# verify that this class implements BaseHTTP(s) connection correctly\nif typing.TYPE_CHECKING:\n    _supports_http_protocol: BaseHTTPConnection = EmscriptenHTTPConnection(\"\", 0)\n    _supports_https_protocol: BaseHTTPSConnection = EmscriptenHTTPSConnection(\"\", 0)\n", "path": "src/urllib3/contrib/emscripten/connection.py"}], "after_files": [{"content": "from __future__ import annotations\n\nimport os\nimport typing\n\n# use http.client.HTTPException for consistency with non-emscripten\nfrom http.client import HTTPException as HTTPException  # noqa: F401\nfrom http.client import ResponseNotReady\n\nfrom ..._base_connection import _TYPE_BODY\nfrom ...connection import HTTPConnection, ProxyConfig, port_by_scheme\nfrom ...exceptions import TimeoutError\nfrom ...response import BaseHTTPResponse\nfrom ...util.connection import _TYPE_SOCKET_OPTIONS\nfrom ...util.timeout import _DEFAULT_TIMEOUT, _TYPE_TIMEOUT\nfrom ...util.url import Url\nfrom .fetch import _RequestError, _TimeoutError, send_request, send_streaming_request\nfrom .request import EmscriptenRequest\nfrom .response import EmscriptenHttpResponseWrapper, EmscriptenResponse\n\nif typing.TYPE_CHECKING:\n    from ..._base_connection import BaseHTTPConnection, BaseHTTPSConnection\n\n\nclass EmscriptenHTTPConnection:\n    default_port: typing.ClassVar[int] = port_by_scheme[\"http\"]\n    default_socket_options: typing.ClassVar[_TYPE_SOCKET_OPTIONS]\n\n    timeout: None | (float)\n\n    host: str\n    port: int\n    blocksize: int\n    source_address: tuple[str, int] | None\n    socket_options: _TYPE_SOCKET_OPTIONS | None\n\n    proxy: Url | None\n    proxy_config: ProxyConfig | None\n\n    is_verified: bool = False\n    proxy_is_verified: bool | None = None\n\n    _response: EmscriptenResponse | None\n\n    def __init__(\n        self,\n        host: str,\n        port: int = 0,\n        *,\n        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,\n        source_address: tuple[str, int] | None = None,\n        blocksize: int = 8192,\n        socket_options: _TYPE_SOCKET_OPTIONS | None = None,\n        proxy: Url | None = None,\n        proxy_config: ProxyConfig | None = None,\n    ) -> None:\n        self.host = host\n        self.port = port\n        self.timeout = timeout if isinstance(timeout, float) else 0.0\n        self.scheme = \"http\"\n        self._closed = True\n        self._response = None\n        # ignore these things because we don't\n        # have control over that stuff\n        self.proxy = None\n        self.proxy_config = None\n        self.blocksize = blocksize\n        self.source_address = None\n        self.socket_options = None\n        self.is_verified = False\n\n    def set_tunnel(\n        self,\n        host: str,\n        port: int | None = 0,\n        headers: typing.Mapping[str, str] | None = None,\n        scheme: str = \"http\",\n    ) -> None:\n        pass\n\n    def connect(self) -> None:\n        pass\n\n    def request(\n        self,\n        method: str,\n        url: str,\n        body: _TYPE_BODY | None = None,\n        headers: typing.Mapping[str, str] | None = None,\n        # We know *at least* botocore is depending on the order of the\n        # first 3 parameters so to be safe we only mark the later ones\n        # as keyword-only to ensure we have space to extend.\n        *,\n        chunked: bool = False,\n        preload_content: bool = True,\n        decode_content: bool = True,\n        enforce_content_length: bool = True,\n    ) -> None:\n        self._closed = False\n        if url.startswith(\"/\"):\n            # no scheme / host / port included, make a full url\n            url = f\"{self.scheme}://{self.host}:{self.port}\" + url\n        request = EmscriptenRequest(\n            url=url,\n            method=method,\n            timeout=self.timeout if self.timeout else 0,\n            decode_content=decode_content,\n        )\n        request.set_body(body)\n        if headers:\n            for k, v in headers.items():\n                request.set_header(k, v)\n        self._response = None\n        try:\n            if not preload_content:\n                self._response = send_streaming_request(request)\n            if self._response is None:\n                self._response = send_request(request)\n        except _TimeoutError as e:\n            raise TimeoutError(e.message) from e\n        except _RequestError as e:\n            raise HTTPException(e.message) from e\n\n    def getresponse(self) -> BaseHTTPResponse:\n        if self._response is not None:\n            return EmscriptenHttpResponseWrapper(\n                internal_response=self._response,\n                url=self._response.request.url,\n                connection=self,\n            )\n        else:\n            raise ResponseNotReady()\n\n    def close(self) -> None:\n        self._closed = True\n        self._response = None\n\n    @property\n    def is_closed(self) -> bool:\n        \"\"\"Whether the connection either is brand new or has been previously closed.\n        If this property is True then both ``is_connected`` and ``has_connected_to_proxy``\n        properties must be False.\n        \"\"\"\n        return self._closed\n\n    @property\n    def is_connected(self) -> bool:\n        \"\"\"Whether the connection is actively connected to any origin (proxy or target)\"\"\"\n        return True\n\n    @property\n    def has_connected_to_proxy(self) -> bool:\n        \"\"\"Whether the connection has successfully connected to its proxy.\n        This returns False if no proxy is in use. Used to determine whether\n        errors are coming from the proxy layer or from tunnelling to the target origin.\n        \"\"\"\n        return False\n\n\nclass EmscriptenHTTPSConnection(EmscriptenHTTPConnection):\n    default_port = port_by_scheme[\"https\"]\n    # all this is basically ignored, as browser handles https\n    cert_reqs: int | str | None = None\n    ca_certs: str | None = None\n    ca_cert_dir: str | None = None\n    ca_cert_data: None | str | bytes = None\n    cert_file: str | None\n    key_file: str | None\n    key_password: str | None\n    ssl_context: typing.Any | None\n    ssl_version: int | str | None = None\n    ssl_minimum_version: int | None = None\n    ssl_maximum_version: int | None = None\n    assert_hostname: None | str | typing.Literal[False]\n    assert_fingerprint: str | None = None\n\n    def __init__(\n        self,\n        host: str,\n        port: int = 0,\n        *,\n        timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT,\n        source_address: tuple[str, int] | None = None,\n        blocksize: int = 16384,\n        socket_options: None\n        | _TYPE_SOCKET_OPTIONS = HTTPConnection.default_socket_options,\n        proxy: Url | None = None,\n        proxy_config: ProxyConfig | None = None,\n        cert_reqs: int | str | None = None,\n        assert_hostname: None | str | typing.Literal[False] = None,\n        assert_fingerprint: str | None = None,\n        server_hostname: str | None = None,\n        ssl_context: typing.Any | None = None,\n        ca_certs: str | None = None,\n        ca_cert_dir: str | None = None,\n        ca_cert_data: None | str | bytes = None,\n        ssl_minimum_version: int | None = None,\n        ssl_maximum_version: int | None = None,\n        ssl_version: int | str | None = None,  # Deprecated\n        cert_file: str | None = None,\n        key_file: str | None = None,\n        key_password: str | None = None,\n    ) -> None:\n        super().__init__(\n            host,\n            port=port,\n            timeout=timeout,\n            source_address=source_address,\n            blocksize=blocksize,\n            socket_options=socket_options,\n            proxy=proxy,\n            proxy_config=proxy_config,\n        )\n        self.scheme = \"https\"\n\n        self.key_file = key_file\n        self.cert_file = cert_file\n        self.key_password = key_password\n        self.ssl_context = ssl_context\n        self.server_hostname = server_hostname\n        self.assert_hostname = assert_hostname\n        self.assert_fingerprint = assert_fingerprint\n        self.ssl_version = ssl_version\n        self.ssl_minimum_version = ssl_minimum_version\n        self.ssl_maximum_version = ssl_maximum_version\n        self.ca_certs = ca_certs and os.path.expanduser(ca_certs)\n        self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)\n        self.ca_cert_data = ca_cert_data\n\n        self.cert_reqs = None\n\n        # The browser will automatically verify all requests.\n        # We have no control over that setting.\n        self.is_verified = True\n\n    def set_cert(\n        self,\n        key_file: str | None = None,\n        cert_file: str | None = None,\n        cert_reqs: int | str | None = None,\n        key_password: str | None = None,\n        ca_certs: str | None = None,\n        assert_hostname: None | str | typing.Literal[False] = None,\n        assert_fingerprint: str | None = None,\n        ca_cert_dir: str | None = None,\n        ca_cert_data: None | str | bytes = None,\n    ) -> None:\n        pass\n\n\n# verify that this class implements BaseHTTP(s) connection correctly\nif typing.TYPE_CHECKING:\n    _supports_http_protocol: BaseHTTPConnection = EmscriptenHTTPConnection(\"\", 0)\n    _supports_https_protocol: BaseHTTPSConnection = EmscriptenHTTPSConnection(\"\", 0)\n", "path": "src/urllib3/contrib/emscripten/connection.py"}]}