How to allow/use self-signed certificates?

193 views
Skip to first unread message

Andrew Havens

unread,
Jul 23, 2012, 5:36:24 PM7/23/12
to capybar...@googlegroups.com
After much debugging, I realized capybara-webkit was failing because we are using a self-signed certificate in development mode. How can I configure capybara-webkit to allow/accept this certificate?

Joe Ferris

unread,
Jul 23, 2012, 6:00:46 PM7/23/12
to capybar...@googlegroups.com
Hey Andrew,

The interface for this is kind of weird at the moment, but you can use this snippet in your specs:

    page.driver.browser.ignore_ssl_errors

-Joe

Andrew Havens

unread,
Jul 23, 2012, 6:41:51 PM7/23/12
to capybar...@googlegroups.com
Sorry, I don't understand where to put that. I am using Cucumber and Capybara. Is this something I put in my env.rb file?

--Andrew

Joe Ferris

unread,
Jul 23, 2012, 6:44:30 PM7/23/12
to capybar...@googlegroups.com
Yes, you could put it in your env.rb file in a Before block:

  Before('@javascript') do
    page.driver.browser.ignore_ssl_errors
  end

-Joe

Andrew Havens

unread,
Jul 24, 2012, 4:51:09 PM7/24/12
to capybar...@googlegroups.com
Okay, it seems that I have gotten past my "Given I am logged in" step. However, the very next call to visit '/somepage' is failing. Besides a few javascript warnings/errors I get this error:

No response received from the server. (Capybara::Driver::Webkit::WebkitNoResponseError)
Connection reset by peer (Errno::ECONNRESET)

How can I figure out what is going on and how to fix it?

--Andrew
Reply all
Reply to author
Forward
0 new messages