Automating the page "There is a problem with this website's security certificate" in Internet Explorer

Last edited on

When using an HTTPS URL of a server with an invalid security certificate Internet Explorer shows this error message:

There is a problem with this website’s security certificate.

The security certificate presented by this website was issued for a different website’s address.

Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server.

We recommend that you close this webpage and do not continue to this website.

Click here to close this webpage.

Continue to this website (not recommended).

More information

However it works to press the Tab key until the entry Continue to this website (not recommended). is highlighted. After that pressing the Return key opens the URL anyway.

We can use this behavior to get past this page in Internet Explorer by sending the same key presses via nativeType() to the browser:

def main():
    loadUrl("https://www.yoursite.com/")
    snooze(3)

    nativeType("<Tab>")
    snooze(0.5)
    nativeType("<Tab>")
    snooze(0.5)
    nativeType("<Tab>")
    snooze(0.5)
    nativeType("<Tab>")
    snooze(0.5)
    nativeType("<Tab>")
    snooze(0.5)

    nativeType("<Return>")

    ...
test.py

Note the snooze() statements that are inserted to wait for Internet Explorer to have loaded the web site and to give it time to process the key presses.

Please also note that the number of Tab key presses can depend on various things, last but not least the number of installed Internet Explorer extensions that show up in the tool bar of Internet Explorer.