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

chrome driver forces https #1846

Open
Magicen0722 opened this issue Apr 26, 2024 · 0 comments
Open

chrome driver forces https #1846

Magicen0722 opened this issue Apr 26, 2024 · 0 comments

Comments

@Magicen0722
Copy link

Magicen0722 commented Apr 26, 2024

What happened?

When I pass an URL to load a website, say, http://yoururl.com, it redirects to https://yoururl.com

options = ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument("--allow-running-insecure-content")
options.add_argument('--ignore-ssl-errors')
options.add_argument('--disable-web-security')
driver = Chrome(options=options,
                use_subprocess=True,
                driver_executable_path=DRIVER_PATH,
                )
driver.get('http://yoururl.com')

What caused it?

Caused by HTTP Strict Transport Security (aka HSTS),mentioned here
It mentioned that you can visit chrome://net-internals/#hsts to unload HSTS preloading through the UI interface for the corresponding URL.
At the same time, you can also exclude the corresponding URL in chrome://settings/content/insecureContent.
But our service needs to be deployed to different servers or virtual machines, it should not be manual.

what i expected?

Is there a way to disable HSTS by using code? Or force the use of http protocol to access the specified URL?

Any help would be grateful!

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

1 participant