FlorianREGAZ / Python-Tls-Client

Advanced HTTP Library
MIT License
660 stars 136 forks source link

failed to do request: Get "https://tls.peet.ws/api/all": remote error: tls: unexpected message #53

Closed wangluozhe closed 1 year ago

wangluozhe commented 1 year ago

tls_client.exceptions.TLSClientExeption: failed to do request: Get "https://www.baidu.com": unknown extension with id 24 provided

config = {'ja3_string': '771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-23-65281-10-11-35-16-5-13-18-51-45-43-27-17513-21-41,29-23-24,0', 'h2_settings': {'HEADER_TABLE_SIZE': 65536, 'MAX_CONCURRENT_STREAMS': 1000, 'INITIAL_WINDOW_SIZE': 6291456, 'MAX_HEADER_LIST_SIZE': 262144}, 'h2_settings_order': ['HEADER_TABLE_SIZE', 'MAX_CONCURRENT_STREAMS', 'INITIAL_WINDOW_SIZE', 'MAX_HEADER_LIST_SIZE'], 'supported_signature_algorithms': ['ECDSAWithP256AndSHA256', 'PSSWithSHA256', 'PKCS1WithSHA256', 'ECDSAWithP384AndSHA384', 'PSSWithSHA384', 'PKCS1WithSHA384', 'PSSWithSHA512', 'PKCS1WithSHA512', 'PKCS1WithSHA1'], 'supported_delegated_credentials_algorithms': None, 'supported_versions': ['GREASE', '1.3', '1.2'], 'key_share_curves': ['GREASE', 'X25519'], 'cert_compression_algo': 'brotli', 'pseudo_header_order': [':method', ':authority', ':scheme', ':path'], 'connection_flow': 15663105, 'priority_frames': None, 'header_order': ['cache-control', 'sec-ch-ua', 'sec-ch-ua-mobile', 'sec-ch-ua-platform', 'upgrade-insecure-requests', 'user-agent', 'accept', 'sec-fetch-site', 'sec-fetch-mode', 'sec-fetch-user', 'sec-fetch-dest', 'accept-encoding', 'accept-language'], 'header_priority': {'weight': 255, 'streamDep': 0, 'exclusive': True}} session = tls_client.Session(*config) headers = { "cache-control": "max-age=0", "sec-ch-ua": '".Not/A)Brand";v="99", "Google Chrome";v="103", "Chromium";v="103"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"Windows"', "upgrade-insecure-requests": "1", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "sec-fetch-site": "none", "sec-fetch-mode": "navigate", "sec-fetch-user": "?1", "sec-fetch-dest": "document", "accept-encoding": "gzip, deflate, br", "accept-language": "zh-CN,zh;q=0.9" } session.update(headers) response = session.get(url="https://www.baidu.com") print(response.text)