wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.9k stars 254 forks source link

Chrome --host-rules argument mapping to http not working #527

Closed OliverTrust closed 2 years ago

OliverTrust commented 2 years ago
options = ChromeOptions()
options.add_argument('--host-rules=MAP github.com 127.0.0.1:5000')
sw_options = {
    'verify_ssl': False
}
driver = Chrome(options=options, seleniumwire_options=sw_options)
driver.get('http://github.com')

123

With selenium or with undetectable browser without selenium-wire, i easy connect to my local server with host rules

testworldhapply commented 2 years ago

me too

wkeeling commented 2 years ago

There is a bug with the verify_ssl option. Basically setting the value of the option to False will switch on SSL verification - which will cause the "Cannot validate certificate hostname..." error you're seeing when using --host-rules.

This will be fixed in the next version. The immediate workaround is to set verify_ssl=True or omit it completely.