diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/net/hippie/client.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb index 53f80d7..feb5025 100644 --- a/lib/net/hippie/client.rb +++ b/lib/net/hippie/client.rb @@ -62,10 +62,7 @@ module Net http.use_ssl = uri.is_a?(URI::HTTPS) http.verify_mode = verify_mode http.set_debug_output(Net::Hippie.logger) - if certificate && key - http.cert = OpenSSL::X509::Certificate.new(certificate) if certificate - http.key = private_key - end + apply_client_tls_to(http) http end @@ -87,6 +84,13 @@ module Net OpenSSL::PKey::RSA.new(key) end end + + def apply_client_tls_to(http) + return if certificate.nil? || key.nil? + + http.cert = OpenSSL::X509::Certificate.new(certificate) if certificate + http.key = private_key + end end end end |
