In this article, we will learn how to
handle an untrusted SSL certificate using selenium webdriver.
But Before that,
What is an Untrusted SSL
Certificate?
A lot of time you might have observed
whenever we tried to access any web page we face message SSL certificates like
below in the case of Chrome.
Similarly In the case of Firefox
There could be many possible reasons for
this message like certificate is expired or certificate does not belong to this
web page etc.
To handle this certificate issue in any web
browser we need to make use of DesiredCapabilities class and then Set
ACCEPT_SSL_CERTS variable equals to true.
Below is the code snapshot to handle this in case of
Chrome.
Below is the code snapshot to handle this in case of
Internet Explorer
Below is the code snapshot to handle this in case of
Safari browser.
To handle this error in case of firefox we
first, need to create a Firefox profile and then setAcceptUntrustedCertificates
as true.
Below is the code snapshot to handle this in the case of Firefox.
Hi, can we acheive this in headless browser.
ReplyHi vaibhav, yes it will work.You need to add code for headless which is also Avilable in this website
ReplyGreat Article
ReplyCyber Security Projects
projects for cse
Networking Projects
JavaScript Training in Chennai
JavaScript Training in Chennai