diff options
| author | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-28 19:06:31 +0000 |
|---|---|---|
| committer | gotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-28 19:06:31 +0000 |
| commit | 28a7386f7d2ce7a3c02b8197d9a2cb4abd5aace3 (patch) | |
| tree | 3d4eb433d72fe4c1d7704966ba6d28fe83bfc1c8 | |
| parent | 2b333e042be7d1c782d1841a8182e0d3fa04fa4a (diff) | |
| download | ruby-28a7386f7d2ce7a3c02b8197d9a2cb4abd5aace3.tar.gz ruby-28a7386f7d2ce7a3c02b8197d9a2cb4abd5aace3.tar.xz ruby-28a7386f7d2ce7a3c02b8197d9a2cb4abd5aace3.zip | |
* ext/openssl/lib/net/https.rb (use_ssl=): raise ProtocolError if
connection is set up already.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | ext/openssl/lib/net/https.rb | 11 |
2 files changed, 15 insertions, 1 deletions
@@ -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. diff --git a/ext/openssl/lib/net/https.rb b/ext/openssl/lib/net/https.rb index 0f5cb1340..fb7f53c55 100644 --- a/ext/openssl/lib/net/https.rb +++ b/ext/openssl/lib/net/https.rb @@ -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 |
