OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
third_party
/
urllib3
/
test
/
with_dummyserver
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2024 08:00:39 AM
rwxr-xr-x
📄
__init__.py
0 bytes
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_chunked_transfer.py
10.43 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_connection.py
4.41 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_connectionpool.py
55.12 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_https.py
44.02 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_no_ssl.py
1.12 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_poolmanager.py
24.49 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_proxy_poolmanager.py
37.48 KB
06/17/2024 08:00:39 AM
rw-r--r--
📄
test_socketlevel.py
87.11 KB
06/17/2024 08:00:39 AM
rw-r--r--
Editing: test_no_ssl.py
Close
""" Test connections without the builtin ssl module Note: Import urllib3 inside the test functions to get the importblocker to work """ from __future__ import annotations import pytest import urllib3 from dummyserver.testcase import ( HTTPSHypercornDummyServerTestCase, HypercornDummyServerTestCase, ) from urllib3.exceptions import InsecureRequestWarning from ..test_no_ssl import TestWithoutSSL class TestHTTPWithoutSSL(HypercornDummyServerTestCase, TestWithoutSSL): def test_simple(self) -> None: with urllib3.HTTPConnectionPool(self.host, self.port) as pool: r = pool.request("GET", "/") assert r.status == 200, r.data class TestHTTPSWithoutSSL(HTTPSHypercornDummyServerTestCase, TestWithoutSSL): def test_simple(self) -> None: with urllib3.HTTPSConnectionPool( self.host, self.port, cert_reqs="NONE" ) as pool: with pytest.warns(InsecureRequestWarning): try: pool.request("GET", "/") except urllib3.exceptions.SSLError as e: assert "SSL module is not available" in str(e)