forcediphttpsadapter icon indicating copy to clipboard operation
forcediphttpsadapter copied to clipboard

Multiple host names on IP

Open maiiabocharova opened this issue 2 years ago • 0 comments

Hello, can you please help me - I am trying to understand how to get responses from IP hosting several websites I found than 34.240.28.46 hosts the site I am trying to get responses from. With normal requests I get:

SSLError: HTTPSConnectionPool(host='34.240.28.46', port=443): Max retries exceeded with url: /jobs/accountancy (Caused by SSLError(CertificateError("hostname '34.240.28.46' doesn't match either of 'totaljobs.com', 'careerstructure.com', 'caterer.com', 'catererglobal.com', 'cityjobs.com', 'cwjobs.co.uk', 'emedcareers.com', 'jobsite.co.uk', 'justengineers.net', 'milkround.com', 'retailchoice.com'")))

When using ForcedIPHTTPSAdapter:

url = 'https://totaljobs.com/jobs/accountancy'
session = requests.Session()
session.mount(url, ForcedIPHTTPSAdapter(dest_ip='34.240.28.46'))
r = session.get(url, verify=False, timeout=10)

I get timeout error. Can somone please help me understand what I am doing wrong

maiiabocharova avatar Mar 19 '23 21:03 maiiabocharova