Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加自定义ja3之后出现pyhttpx.exception.TLSDecryptErrorExpetion: handshake failed!, server encrypt error #25

Open
Stimexy opened this issue Aug 3, 2023 · 2 comments

Comments

@Stimexy
Copy link

Stimexy commented Aug 3, 2023

`import pyhttpx

s = pyhttpx.HttpSession(browser_type='chrome',shuffle_proto=True,http2=True,ja3='xxxxxxxx')

headers = {
'Host': 'h5api.m.taobao.com',
'Cookie': 'cna=8Q3YGz07qjYCAXPuK+KDq6Bv; thw=cn; tfstk=d2opj-Do8B83tYGHEyLGa8TUILJMmDHUBXkfq7VhPfht_flnKYDS2VHqwWvy8k0TwfGTOuqnx3386Xsu-0HP28MSapPkLFDELurWiImJmvkE4URDihm8BJqzVIAcLWuYkulfPuXO31gk6vPs087Y0vWxn5I52LeLRSNU6gsSXJH3GO8ZmmlsKywaXwp9Ba7zRR8QUHAV.; l=fBP5rKHVN_JgVzHYBOfZrurza7-FSIRA_uPzaNbMi9fPOBCB56fCW1gzQxL6C3NRFs_MR3J9ORFeBeYBVQd-nxvtMUO4flMmn_sLn7C..; isg=BKys-3Jn5Dr7IfB2oImKQi9NfYjeZVAP9xxT_gbtuNf6EUwbLnUgn6KjNd-pgohn',
'user-agent': 'Mozilla/5.0 (Linux; Android 9; Pixel 3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 Mobile Safari/537.36',
'accept': '/',
'referer': 'https://h5.m.taobao.com/awp/core/detail.htm?id=663933227946&spm=a2141.7631671.content.15',
'accept-language': 'zh-CN,zh;q=0.9',
}

params = {
'jsv': '2.7.0',
'appKey': '12574478',
't': '1690970350688',
'sign': '60f14199bc935d0323469723695dcbbb',
'api': 'mtop.taobao.detail.getdetail',
'v': '6.0',
'ttid': '202012@taobao_h5_9.17.0',
'isSec': '0',
'ecode': '0',
'AntiFlood': 'true',
'AntiCreep': 'true',
'H5Request': 'true',
'type': 'jsonp',
'dataType': 'jsonp',
'safariGoLogin': 'true',
'mainDomain': 'taobao.com',
'subDomain': 'm',
'prefix': 'h5api',
'getJSONP': 'true',
'callback': 'mtopjsonp1',
'data': '{"id":"663933227946","spm":"a2141.7631671.content.15","detail_v":"3.5.0","exParams":"{\"id\":\"663933227946\",\"spm\":\"a2141.7631671.content.15\",\"appReqFrom\":\"detail\",\"container_type\":\"xdetail\",\"dinamic_v3\":\"true\",\"supportV7\":\"true\",\"ultron2\":\"true\",\"pageSource\":\"1\"}","itemNumId":"663933227946","pageCode":"miniAppDetail","from":"miniapp","openFrom":"pagedetail"}',
}

response = s.get(
'https://h5api.m.taobao.com/h5/mtop.taobao.detail.getdetail/6.0/',
params=params,
headers=headers
)
print(response.text)`

出现了以下错误:
File "C:\Python3.7\lib\site-packages\pyhttpx\session.py", line 532, in get
resp = self.request('GET', url, **kwargs)
File "C:\Python3.7\lib\site-packages\pyhttpx\session.py", line 204, in request
self.connpool, self.conn = self.get_conn(req, addr)
File "C:\Python3.7\lib\site-packages\pyhttpx\session.py", line 289, in get_conn
conn = connpool._get_conn()
File "C:\Python3.7\lib\site-packages\pyhttpx\session.py", line 95, in _get_conn
return conn or self._new_conn()
File "C:\Python3.7\lib\site-packages\pyhttpx\session.py", line 84, in _new_conn
proxies=self.req.proxies,)
File "C:\Python3.7\lib\site-packages\pyhttpx\layers\tls\pyssl.py", line 211, in connect
return self._tls_do_handshake13()
File "C:\Python3.7\lib\site-packages\pyhttpx\layers\tls\pyssl.py", line 400, in _tls_do_handshake13
raise TLSDecryptErrorExpetion('handshake failed!, server encrypt error')
pyhttpx.exception.TLSDecryptErrorExpetion: handshake failed!, server encrypt error

@CSN7841
Copy link

CSN7841 commented Dec 17, 2023

我也遇到了这个,如何解决?

@bfy2000
Copy link

bfy2000 commented Apr 3, 2024

可能是ja3写的有问题,每个数字都有含义的,不能完全随机

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants