Closed mattbrictson closed 12 years ago
Another me too, adding work around for mechanize
agent = Mechanize.new
agent.agent.http.reuse_ssl_sessions = false
I'll need to add code to detect if fakeweb is active to disable SSL session reuse automatically, but it'll have to wait until after the mechanize bugfix release.
Fixed by #14
By default, net-http-persistent has the option
reuse_ssl_sessions = true
, which causes Net::HTTP::Persistent::SSLReuse to be used as the underlying http class, rather than Net::HTTP. SSLReuse redefinesconnect
to use the socket layer directly. The first line is:This apparently breaks higher level http mocking libraries. For example, when using the vcr gem with fakeweb mocking, I expect vcr to replay a previously recorded http interaction. Instead, I get an error like this:
Currently, my workaround is to prevent net-http-persistent from using the SSLReuse class during tests.
Perhaps this there is no other way around this, but I thought I should at least document the problem here, as a Google search did not turn up any other explanations.