In Firefox, you should set 'accept_untrusted_certs' of FirefoxProfile() option to True. Code:
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
driver.get('https://cacert.org/')
driver.close()
In case of Chrome, you have to add --ignore-certificate-errors to ChromeOptions() argument:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
driver = webdriver.Chrome(chrome_options=options)
driver.get('https://cacert.org/')
driver.close()
And with Internet Explorer, you have to set acceptSslCerts desired capability:
from selenium import webdriver
capabilities = webdriver.DesiredCapabilities().INTERNETEXPLORER
capabilities['acceptSslCerts'] = True
driver = webdriver.Ie(capabilities=capabilities)
driver.get('https://cacert.org/')
driver.close()
In fact we can use desired capabilities for pretty much every browser. Look at the Desired Capabilities documentation for how it is done: https://code.google.com/p/selenium/wiki/DesiredCapabilities