Skip to content

Commit

Permalink
SSLの証明書は検証すべき
Browse files Browse the repository at this point in the history
  • Loading branch information
znz authored and cho45 committed Dec 18, 2009
1 parent fd1fa08 commit 19280b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/tig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def initialize(*args)
@utf7 =
@httpproxy = nil
@ratelimit = RateLimit.new(150)
@cert_store = OpenSSL::X509::Store.new
@cert_store.set_default_paths
end

def on_user(m)
Expand Down Expand Up @@ -2141,7 +2143,8 @@ def http(uri, open_timeout = nil, read_timeout = 60)
http.read_timeout = read_timeout if read_timeout # 60 by default
if uri.is_a? URI::HTTPS
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.cert_store = @cert_store
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
http
rescue => e
Expand Down

0 comments on commit 19280b2

Please sign in to comment.