有没有办法在单个RestClient连接上强制使用SSL版本?
我需要将它设置为“SSLv3”。
我可以使用以下命令对所有连接执行此操作:
OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = 'SSLv3'但这当然太全球化了。
当尝试在初始化中传递参数时,它不起作用:
RestClient::Resource.new('https://example.com',:ssl_version => "SSLv3")发布于 2013-08-07 11:05:28
您可以像这样使用调用:
RestClient::Request.execute(:url => 'https://example.com', :ssl_version => 'SSLv3', :method => 'get')但请注意,旧版本的rest-client会默默地丢弃:ssl_version选项。您可以使用伪造的SSL版本来测试是否发生了这种情况:
>> RestClient::Request.execute(:url => 'https://example.com', :ssl_version => 'blah', :method => 'get')
ArgumentError: unknown SSL method `blah'.
from /usr/lib/ruby/1.9.1/openssl/ssl-internal.rb:38:in `ssl_version='https://stackoverflow.com/questions/17375066
复制相似问题