Skip to content

Commit 5d352d2

Browse files
Merge pull request #7 from koenrh/fix/tls-verification
Turn on verification of TLS certificates
2 parents bcc23e2 + 99b0d4e commit 5d352d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ruby_http_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def add_ssl(http)
181181
protocol = host.split(':')[0]
182182
if protocol == 'https'
183183
http.use_ssl = true
184-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
184+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
185185
end
186186
http
187187
end

test/test_ruby_http_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def add_ssl
100100
http = Net::HTTP.new(uri.host, uri.port)
101101
http = @client.add_ssl(http)
102102
assert_equal(http.use_ssl, true)
103-
assert_equal(http.verify_mode, OpenSSL::SSL::VERIFY_NONE)
103+
assert_equal(http.verify_mode, OpenSSL::SSL::VERIFY_PEER)
104104
end
105105

106106
def test__

0 commit comments

Comments
 (0)