From: Brian Candler Date: 2009-12-07T16:01:47+09:00 Subject: Re: How to use tls1 but not sslv2/3 in https? Liping Bao wrote: > Brian Candler wrote: >> if uri.scheme == "https" >> http.instance_eval { @ssl_context = >> OpenSSL::SSL::SSLContext.new(:TLSv1) } >> http.use_ssl = true >> end >> > > Thanks a lot! It works for me. > >> if started? and @use_ssl != flag >> if flag and not @ssl_context >> - @ssl_context = OpenSSL::SSL::SSLContext.new >> + @ssl_context = flag == true ? OpenSSL::SSL::SSLContext.new : >> OpenSSL::SSL::SSLContext.new(flag) >> end > Sorry, I do not understand the code segment. What kind of improvement > do you mean? I think the current usage is ok for me. It would let you say http.use_ssl = :TLSv1 -- Posted via http://www.ruby-forum.com/.