我正在尝试通过直接IP地址(172.217.0.78)访问"https://google.com"
我给了主机头并正确指定了它,但我仍然遇到错误。 任何人都可以帮我解决一下我们如何解决问题吗?
requests.get("https://172.217.0.78", headers={"Host": "google.com"}, verify=True)
UNCAUGHT EXCEPTION SSLError: hostname '172.217.0.78' doesn't match either of '*.google.com', '*.android.com', '*.appengine.google.com', '*.cloud.google.com', '*.db833953.google.cn', '*.g.co', '*.gcp.gvt2.com', '*.google-analytics.com', '*.google.ca', '*.google.cl', '*.google.co.in', '*.google.co.jp', '*.google.co.uk', '*.google.com.ar', '*.google.com.au', '*.google.com.br', '*.google.com.co', '*.google.com.mx', '*.google.com.tr', '*.google.com.vn', '*.google.de', '*.google.es', '*.google.fr', '*.google.hu', '*.google.it', '*.google.nl', '*.google.pl', '*.google.pt', '*.googleadapis.com', '*.googleapis.cn', '*.googlecommerce.com', '*.googlevideo.com', '*.gstatic.cn', '*.gstatic.com', '*.gvt1.com', '*.gvt2.com', '*.metric.gstatic.com', '*.urchin.com', '*.url.google.com', '*.youtube-nocookie.com', '*.youtube.com', '*.youtubeeducation.com', '*.yt.be', '*.ytimg.com', 'android.clients.google.com', 'android.com', 'developer.android.google.cn', 'developers.android.google.cn', 'g.co', 'goo.gl', 'google-analytics.com', 'google.com', 'googlecommerce.com', 'source.android.google.cn', 'urchin.com', 'www.goo.gl', 'youtu.be', 'youtube.com', 'youtubeeducation.com', 'yt.be'
<stdin>:1 [<module>]
/usr/lib/python3/dist-packages/requests/api.py:65 [get] return request('get', url, **kwargs)
/usr/lib/python3/dist-packages/requests/api.py:49 [request] response = session.request(method=method, url=url, **kwargs)
/usr/lib/python3/dist-packages/requests/sessions.py:461 [request] resp = self.send(prep, **send_kwargs)
/usr/lib/python3/dist-packages/requests/sessions.py:573 [send] r = adapter.send(request, **kwargs)
/usr/lib/python3/dist-packages/requests/adapters.py:431 [send] raise SSLError(e, request=request)