1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/lib/net/https.rb (use_ssl=): raise ProtocolError if

connection is set up already.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gotoyuzo 2003-07-28 19:06:31 +00:00
parent e156194ce6
commit ea837fc6fe
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Jul 29 03:53:28 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/lib/net/https.rb (use_ssl=): raise ProtocolError if
connection is set up already.
Mon Jul 28 23:23:08 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* file.c (Init_File): IO should include File::Const.

View file

@ -137,7 +137,7 @@ module Net
SSLIO
end
attr_accessor :use_ssl
attr_reader :use_ssl
attr_writer :key, :cert
attr_writer :ca_file, :ca_path
attr_writer :verify_mode, :verify_callback, :verify_depth
@ -150,6 +150,14 @@ module Net
default_initialize(*args)
@key = @cert = @ca_file = @ca_path = @verify_mode =
@verify_callback = @verify_depth = @timeout = @cert_store = nil
@already_connected = false
end
def use_ssl=(flag)
if @already_connected && !@use_ssl
raise ProtocolError, "connection is alrady set up"
end
@use_ssl = flag
end
def on_connect
@ -173,6 +181,7 @@ module Net
@socket.ssl_connect
@peer_cert = @socket.peer_cert
end
@already_connected = true
end
end