Permalink
Browse files

Add #cert and #key aliases

for users familiar with Net::HTTP
  • Loading branch information...
1 parent 881c433 commit 3a4f3cd3312397e852704d561ad682a7111f1f7c @dlee dlee committed Apr 18, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/net/http/persistent.rb
View
@@ -190,6 +190,9 @@ class Error < StandardError; end
attr_reader :certificate
+ # For Net::HTTP parity
+ alias cert certificate
+
##
# An SSL certificate authority. Setting this will set verify_mode to
# VERIFY_PEER.
@@ -269,6 +272,9 @@ class Error < StandardError; end
attr_reader :private_key
+ # For Net::HTTP parity
+ alias key private_key
+
##
# The URL through which requests will be proxied
@@ -420,6 +426,9 @@ def certificate= certificate
reconnect_ssl
end
+ # For Net::HTTP parity
+ alias cert= certificate=
+
##
# Sets the SSL certificate authority file.
@@ -680,6 +689,9 @@ def private_key= key
reconnect_ssl
end
+ # For Net::HTTP parity
+ alias key= private_key=
+
##
# Sets the proxy server. The +proxy+ may be the URI of the proxy server,
# the symbol +:ENV+ which will read the proxy from the environment or nil to

0 comments on commit 3a4f3cd

Please sign in to comment.