OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
requests_toolbelt
/
adapters
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
07/12/2020 04:36:15 PM
rwxr-xr-x
📄
__init__.py
363 bytes
01/19/2017 02:23:03 PM
rw-r--r--
📁
__pycache__
-
07/12/2020 04:36:15 PM
rwxr-xr-x
📄
appengine.py
7.36 KB
03/25/2017 11:07:58 AM
rw-r--r--
📄
fingerprint.py
1.37 KB
01/19/2017 02:23:03 PM
rw-r--r--
📄
host_header_ssl.py
1.36 KB
01/19/2017 02:23:03 PM
rw-r--r--
📄
socket_options.py
4.19 KB
01/19/2017 02:23:03 PM
rw-r--r--
📄
source.py
2.55 KB
01/19/2017 02:23:03 PM
rw-r--r--
📄
ssl.py
2.34 KB
01/19/2017 02:23:03 PM
rw-r--r--
Editing: host_header_ssl.py
Close
# -*- coding: utf-8 -*- """ requests_toolbelt.adapters.host_header_ssl ========================================== This file contains an implementation of the HostHeaderSSLAdapter. """ from requests.adapters import HTTPAdapter class HostHeaderSSLAdapter(HTTPAdapter): """ A HTTPS Adapter for Python Requests that sets the hostname for certificate verification based on the Host header. This allows requesting the IP address directly via HTTPS without getting a "hostname doesn't match" exception. Example usage: >>> s.mount('https://', HostHeaderSSLAdapter()) >>> s.get("https://93.184.216.34", headers={"Host": "example.org"}) """ def send(self, request, **kwargs): # HTTP headers are case-insensitive (RFC 7230) host_header = None for header in request.headers: if header.lower() == "host": host_header = request.headers[header] break connection_pool_kwargs = self.poolmanager.connection_pool_kw if host_header: connection_pool_kwargs["assert_hostname"] = host_header elif "assert_hostname" in connection_pool_kwargs: # an assert_hostname from a previous request may have been left connection_pool_kwargs.pop("assert_hostname", None) return super(HostHeaderSSLAdapter, self).send(request, **kwargs)