If you’re developing a web app that has a SSL certificate and for whatever reason the url being used to access the app doesn’t match the one stored in the certificate, then you’ll get a little warning message from the browser (example taken from FireFox):

You have attempted to establish a connection with “url-used-in-the-browser”. However, the security certificate presented belongs to “url-defined-in-the-certificate”. It is possible, though unlikely, that someone may be trying to intercept your communication with this site.

Most of the time, this invalid certificate warning is merely an annoyance. By clicking “OK” you can continue to the site without having to worry about the certificate problem for the remainder of the session. But if you are attempting to run automated Selenium tests against your web app, this little warning prompt is troublesome.

Selenium is an awesome test framework that uses JavaScript to run tests against your web app. By loading a single url in your browser, Selenium can run a whole suite of tests. But if there’s a ssl cert warning message, everything grinds to a halt. Unfortunately Selenium’s JavaScript can’t click the “OK” button to get past the message. This is bad if your tests are running automatically.

A solution to this problem is to use FireFox with the Remember Mismatched Domains (RMD) addon. This awesome addon written by Andrew Lucking gives the user the option to remember which url’s loaded into the browser have mismatched ssl certificates. Now once you “OK” one of these urls, you have to option to have FireFox remember. From that point on, you won’t end up with that pesky little warning message.

And if you’re running FireFox on OS X, check out this blog post or click here to install RMD for FireFox on OS X.