Mocking certificate using WebMock Rails
Asked Answered
S

1

6

I have a webscraper in ruby that analyses certificates by using this:

http = Net::HTTP.new(http_endpoint.host, http_endpoint.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start do |h|
    @cert = h.peer_cert
end

Is it possible to mock this request using webmock and give a fake certificate during testing?

Subsidize answered 15/2, 2017 at 17:26 Comment(0)
O
-1

I see that this is an old question but this might help

Obese answered 2/12, 2020 at 15:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.