<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.townx.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>townx - Dealing with self-signed SSL certificates when running Selenium server with Firefox - Comments</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox</link>
 <description>Comments for &quot;Dealing with self-signed SSL certificates when running Selenium server with Firefox&quot;</description>
 <language>en</language>
<item>
 <title>Nice</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-41352</link>
 <description>&lt;p&gt;Thanks a lot. It really worked for me. Very nice job.&lt;/p&gt;</description>
 <pubDate>Wed, 25 May 2011 01:32:25 -0500</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 41352 at http://www.townx.org</guid>
</item>
<item>
 <title>Hi All,

If you are still</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-41313</link>
 <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;If you are still having problems with self-signed &lt;span class=&quot;caps&quot;&gt;SSL &lt;/span&gt;certificates in &lt;span class=&quot;caps&quot;&gt;FF, &lt;/span&gt;check out my solution.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://jktechtrip.wordpress.com/2011/04/14/selenium-and-self-signed-ssl-certificates-in-firefox-java-linux/&quot; title=&quot;http://jktechtrip.wordpress.com/2011/04/14/selenium-and-self-signed-ssl-certificates-in-firefox-java-linux/&quot;&gt;http://jktechtrip.wordpress.com/2011/04/14/selenium-and-self-signed-ssl-...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope this work also for you :)&lt;/p&gt;

&lt;p&gt;Regards,&lt;br /&gt;
J&lt;/p&gt;</description>
 <pubDate>Fri, 15 Apr 2011 05:20:25 -0500</pubDate>
 <dc:creator>J</dc:creator>
 <guid isPermaLink="false">comment 41313 at http://www.townx.org</guid>
</item>
<item>
 <title>even simpler solution...</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-41128</link>
 <description>&lt;p&gt;Just use a (reverse) proxy. You may use Apache for that purpose. Selenium connects via &lt;a href=&quot;http://your.site&quot; title=&quot;http://your.site&quot;&gt;http://your.site&lt;/a&gt; to the proxy and the proxy connects to &lt;a href=&quot;https://your.site&quot; title=&quot;https://your.site&quot;&gt;https://your.site&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Set up the reverse proxy on your localhost and put &quot;127.0.0.1 your.site&quot; into /etc/hosts and tell the reverse proxy to use the true IP instead of &quot;your.site&quot;.&lt;/p&gt;

&lt;p&gt;Should work in most cases...&lt;/p&gt;</description>
 <pubDate>Tue, 30 Nov 2010 22:41:03 -0600</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 41128 at http://www.townx.org</guid>
</item>
<item>
 <title>Kevin, thanks, I&#039;ll take a</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-40537</link>
 <description>&lt;p&gt;Kevin, thanks, I&#039;ll take a look next time I come across this issue.&lt;/p&gt;</description>
 <pubDate>Fri, 23 Apr 2010 17:28:47 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 40537 at http://www.townx.org</guid>
</item>
<item>
 <title>Alternative approach</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-40513</link>
 <description>&lt;p&gt;Hi Elliot,&lt;/p&gt;

&lt;p&gt;I came up with another way to do this.  It&#039;s probably not any simpler, but it will handle all &lt;span class=&quot;caps&quot;&gt;SSL &lt;/span&gt;certificates, so you won&#039;t constantly have to create new Firefox profiles.  The article is at:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium&quot; title=&quot;http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certificates-in-selenium&quot;&gt;http://mogotest.com/blog/2010/04/13/how-to-accept-self-signed-ssl-certif...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;-- &lt;br /&gt;
Kevin&lt;/p&gt;</description>
 <pubDate>Tue, 13 Apr 2010 20:24:15 -0500</pubDate>
 <dc:creator>Kevin Menard</dc:creator>
 <guid isPermaLink="false">comment 40513 at http://www.townx.org</guid>
</item>
<item>
 <title>This really worked for me..</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-40476</link>
 <description>&lt;p&gt;This really worked for me.. Thanks a lot!!!!!!!!!!&lt;/p&gt;</description>
 <pubDate>Tue, 30 Mar 2010 08:09:42 -0500</pubDate>
 <dc:creator>Rahul</dc:creator>
 <guid isPermaLink="false">comment 40476 at http://www.townx.org</guid>
</item>
<item>
 <title>This article really helped</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-40271</link>
 <description>&lt;p&gt;This article really helped me a lot.&lt;br /&gt;
I was tired of this problem for many days.&lt;br /&gt;
Thanks a lot!&lt;/p&gt;</description>
 <pubDate>Wed, 20 Jan 2010 03:25:01 -0600</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 40271 at http://www.townx.org</guid>
</item>
<item>
 <title>Sorry, not really sure about</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-40046</link>
 <description>&lt;p&gt;Sorry, not really sure about IE :)&lt;/p&gt;</description>
 <pubDate>Tue, 03 Nov 2009 18:12:06 -0600</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 40046 at http://www.townx.org</guid>
</item>
<item>
 <title>Thanks!!!</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39982</link>
 <description>&lt;p&gt;Finally it&#039;s working! :)&lt;br /&gt;
But could you tell me a similar trick for IE (IE6)? Still have to accept the certificates by hand while using Selenium &lt;span class=&quot;caps&quot;&gt;RC.&lt;/span&gt;&lt;/p&gt;</description>
 <pubDate>Tue, 20 Oct 2009 06:43:10 -0500</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 39982 at http://www.townx.org</guid>
</item>
<item>
 <title>You&#039;re welcome.</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39958</link>
 <description>&lt;p&gt;You&#039;re welcome.&lt;/p&gt;</description>
 <pubDate>Mon, 12 Oct 2009 15:32:55 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 39958 at http://www.townx.org</guid>
</item>
<item>
 <title>You&#039;re more than welcome. It</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39957</link>
 <description>&lt;p&gt;You&#039;re more than welcome. It was very annoying for me, too, while it was broken.&lt;/p&gt;</description>
 <pubDate>Mon, 12 Oct 2009 15:31:33 -0500</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">comment 39957 at http://www.townx.org</guid>
</item>
<item>
 <title>Elliot. Thanks for the post.</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39956</link>
 <description>&lt;p&gt;Elliot. Thanks for the post. Its working great for me.&lt;br /&gt;
Thanks you so mucccccch!&lt;/p&gt;</description>
 <pubDate>Mon, 12 Oct 2009 12:31:47 -0500</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 39956 at http://www.townx.org</guid>
</item>
<item>
 <title>Thanks a lot for this</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39939</link>
 <description>&lt;p&gt;Thanks a lot for this&lt;/p&gt;</description>
 <pubDate>Wed, 07 Oct 2009 09:54:55 -0500</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 39939 at http://www.townx.org</guid>
</item>
<item>
 <title>Worked great for me - thanks.</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39891</link>
 <description>&lt;p&gt;Worked great for me - thanks.&lt;/p&gt;</description>
 <pubDate>Thu, 17 Sep 2009 14:13:40 -0500</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 39891 at http://www.townx.org</guid>
</item>
<item>
 <title>I am using LoggingSelenium,</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comment-39862</link>
 <description>&lt;p&gt;I am using LoggingSelenium, becuase it generates nice html reports, but your approach doesnt seem to work here. Any thoughts ? I am still struggling get rid of certificate exceptions. Thanks in advance.&lt;/p&gt;

&lt;p&gt;protected LoggingSelenium mySelenium;&lt;br /&gt;
LoggingCommandProcessor myProcessor = new LoggingCommandProcessor(new HttpCommandProcessor(SELENIUM_SERVER, &lt;span class=&quot;caps&quot;&gt;SELENIUM&lt;/span&gt;_PORT, &lt;span class=&quot;caps&quot;&gt;BROWSER&lt;/span&gt;_TYPE,BASE_URL), htmlFormatter);&lt;br /&gt;
myProcessor.setExcludedCommands(new String[] {});&lt;br /&gt;
mySelenium = new LoggingDefaultSelenium(myProcessor);&lt;br /&gt;
mySelenium.start();	&lt;/p&gt;</description>
 <pubDate>Sat, 05 Sep 2009 00:36:26 -0500</pubDate>
 <dc:creator>Sss</dc:creator>
 <guid isPermaLink="false">comment 39862 at http://www.townx.org</guid>
</item>
<item>
 <title>Dealing with self-signed SSL certificates when running Selenium server with Firefox</title>
 <link>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://seleniumhq.org/&quot;&gt;Selenium&lt;/a&gt; is a decent tool for testing web UIs, with good integration with a variety of languages. We use it on &lt;a href=&quot;http://talis.com/prism&quot;&gt;Talis Prism&lt;/a&gt; for testing the &lt;span class=&quot;caps&quot;&gt;UI, &lt;/span&gt;running a Selenium server instance then firing Ruby rspec tests and an older &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;suite at it. Here&#039;s the part of the Ant build script which runs the &lt;span class=&quot;caps&quot;&gt;HTML &lt;/span&gt;suite using Selenium :&lt;/p&gt;



&lt;pre&gt;
&amp;lt;target name=&amp;quot;prism-selenium-tests&amp;quot; description=&amp;quot;Run the old Prism Selenium tests&amp;quot;&amp;gt;
  &amp;lt;echo message=&amp;quot;Running old Selenium tests against Prism&amp;quot; /&amp;gt;
  &amp;lt;java jar=&amp;quot;test/dependencies/Selenium/selenium-server.jar&amp;quot; fork=&amp;quot;true&amp;quot; maxmemory=&amp;quot;1024m&amp;quot;&amp;gt;
    &amp;lt;arg line=&amp;quot;-debug -timeout 500 -htmlSuite &#039;*chrome ${firefox.bin}&#039; http://${prism.host} \
       test/selenium/testSuite.html doc/seleniumResults.html&amp;quot; /&amp;gt;
  &amp;lt;/java&amp;gt;
&amp;lt;/target&amp;gt;
&lt;/pre&gt;



&lt;p&gt;where the variables we interpose are:&lt;/p&gt;



&lt;pre&gt;
${firefox.bin} = path to the Firefox binary to use
${prism.host} = HTTP host to run the tests against
&lt;/pre&gt;



&lt;p&gt;This works without a hitch if you&#039;re not using &lt;span class=&quot;caps&quot;&gt;HTTPS&lt;/span&gt;; but as soon as your tests redirect to an &lt;span class=&quot;caps&quot;&gt;HTTPS URL &lt;/span&gt;on the same host (we serve parts of Prism over &lt;span class=&quot;caps&quot;&gt;SSL&lt;/span&gt;), where your &lt;span class=&quot;caps&quot;&gt;SSL &lt;/span&gt;certificate is self-signed, things go wrong. As Selenium effectively runs Firefox with a new profile every time, you potentially lose any certificate exceptions you might accept.&lt;/p&gt;

&lt;p&gt;One technique we were using was to create a custom profile; run Firefox using that profile; browse to the &lt;span class=&quot;caps&quot;&gt;HTTPS URL &lt;/span&gt;and accept the exception into that profile; then close the profile.&lt;/p&gt;

&lt;p&gt;This kind of worked, but we still got odd popups from Firefox about new extensions being installed. Just annoying.&lt;/p&gt;

&lt;p&gt;I think I&#039;ve now worked out the solution, which was largely based on &lt;a href=&quot;http://kapanka.com/2008/12/selenium-rc-firefox-and-the-self-signed-ssl-cert/&quot; title=&quot;http://kapanka.com/2008/12/selenium-rc-firefox-and-the-self-signed-ssl-cert/&quot;&gt;http://kapanka.com/2008/12/selenium-rc-firefox-and-the-self-signed-ssl-c...&lt;/a&gt;. It&#039;s a bit of a pain in the arse, but it does seem to work. Here goes.&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Close down any running Firefox instances.&lt;/li&gt;
&lt;li&gt;Start Firefox (the one you&#039;re going to run your tests with) with the profile manager: &lt;code&gt;firefox -ProfileManager&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a new profile. You&#039;ll be prompted to choose a directory for the profile. Put it somewhere inside the project where you&#039;re writing the tests.&lt;/li&gt;
&lt;li&gt;Select the profile and run Firefox using it.&lt;/li&gt;
&lt;li&gt;Browse to the &lt;span class=&quot;caps&quot;&gt;HTTPS URL &lt;/span&gt;(with self-signed certificate) you&#039;re going to be testing against.&lt;/li&gt;
&lt;li&gt;Accept the self-signed certificate when prompted. This creates an exception for it in the profile.&lt;/li&gt;
&lt;li&gt;Close the browser.&lt;/li&gt;
&lt;li&gt;Go to the Firefox profile directory.&lt;/li&gt;
&lt;li&gt;Delete everything in the directory except for the &lt;strong&gt;cert_override.txt&lt;/strong&gt; and &lt;strong&gt;cert8.db&lt;/strong&gt; files.&lt;/li&gt;
&lt;li&gt;When you run your Selenium server (like in my Ant example above), pass a &lt;code&gt;-firefoxProfileTemplate /path/to/profile/dir&lt;/code&gt; argument to it. This tells Selenium to use your partial profile (with certificate exceptions) as a basis for minting its new profile. So you get the certificate exceptions, but without any of the other clutter you would get if you used a whole profile.&lt;/li&gt;
&lt;/ol&gt;



&lt;p&gt;The Ant task above, with this option, looks like this:&lt;/p&gt;



&lt;pre&gt;
&amp;lt;target name=&amp;quot;prism-selenium-tests&amp;quot; description=&amp;quot;Run the old Prism Selenium tests&amp;quot;&amp;gt;
  &amp;lt;echo message=&amp;quot;Running old Selenium tests against Prism&amp;quot; /&amp;gt;
  &amp;lt;java jar=&amp;quot;test/dependencies/Selenium/selenium-server.jar&amp;quot; fork=&amp;quot;true&amp;quot; maxmemory=&amp;quot;1024m&amp;quot;&amp;gt;
    &amp;lt;arg line=&amp;quot;-debug -timeout 500 -firefoxProfileTemplate test/firefoxProfile \
       -htmlSuite &#039;*chrome ${firefox.bin}&#039; http://${prism.host} test/selenium/testSuite.html doc/seleniumResults.html&amp;quot; /&amp;gt;
  &amp;lt;/java&amp;gt;
&amp;lt;/target&amp;gt;
&lt;/pre&gt;



&lt;p&gt;Outside of Ant, the command might look something like:&lt;/p&gt;



&lt;pre&gt;
java -jar test/dependencies/Selenium/selenium-server.jar -firefoxProfileTemplate /path/to/profile \
-htmlSuite &#039;*chrome firefox-bin&#039; &lt;a href=&quot;http://host.com&quot; title=&quot;http://host.com&quot;&gt;http://host.com&lt;/a&gt; testSuite.html seleniumResults.html
&lt;/pre&gt;



&lt;p&gt;Works for me.&lt;/p&gt;</description>
 <comments>http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox#comments</comments>
 <category domain="http://www.townx.org/tech">tech</category>
 <category domain="http://www.townx.org/howtos">howtos</category>
 <pubDate>Wed, 14 Jan 2009 12:58:34 -0600</pubDate>
 <dc:creator>elliot</dc:creator>
 <guid isPermaLink="false">766 at http://www.townx.org</guid>
</item>
</channel>
</rss>

