Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCR Does Not Support Recording Broken SSL Certs #651

Closed
shalecraig opened this issue Jun 10, 2017 · 1 comment · Fixed by #916
Closed

VCR Does Not Support Recording Broken SSL Certs #651

shalecraig opened this issue Jun 10, 2017 · 1 comment · Fixed by #916

Comments

@shalecraig
Copy link

I tried to use VCR (with excon, if that matters) to record various types of errors so I can make sure a client library handles them correctly.

In the code before serialization, it doesn't seem like TLS issues are considered.

Here's a code snippet that fails:

puts VCR.version
# => 3.0.3
VCR.use_cassette('attempt_1', serialize_with: :json) do
  begin
    Excon.get('https://expired.badssl.com/') # SSL cert has expired.
  rescue => e
    # log something here
  end
end

The JSON failure is on this line, response is nil, and thererefore VCR fails with the following truncated snippet:

NoMethodError: undefined method `to_hash' for nil:NilClass
[....]/lib/vcr/structs.rb:497:in `to_hash'
@andrehjr
Copy link
Contributor

andrehjr commented Dec 29, 2021

I've tried this with a different combination of VCR/webmock/excon versions and wasn't able to reproduce this error 🤔

I was able to reproduce when using hook_into :excon. I'll try to make fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants