test reproducing ssl error blocking clean connection exit

This commit is contained in:
HoneyryderChuck 2024-01-13 00:20:28 +00:00
parent cc4b8d4c9e
commit dc7b41e7da

View File

@ -0,0 +1,20 @@
# frozen_string_literal: true
require "test_helper"
require "support/http_helpers"
require "support/minitest_extensions"
class HTTPX::SSL
def write(*)
raise OpenSSL::SSL::SSLError, "SSL_write"
end
end
class CleanExitOnSslCorruptionTest < Minitest::Test
include HTTPHelpers
def test_clean_exit_on_ssl_write_error
response = HTTPX.get("https://#{httpbin}/get")
verify_error_response(response, OpenSSL::SSL::SSLError)
end
end