Skip to content

Commit

Permalink
Add method to test all available SSL methods
Browse files Browse the repository at this point in the history
  • Loading branch information
auxesis committed Dec 25, 2017
1 parent 32f5196 commit 938702c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scraper.rb
Expand Up @@ -165,7 +165,23 @@ def new_convictions
convictions_index_at_source.reject { |r| existing_record_ids.include?(r['link']) }
end

def test_ssl_methods
working = OpenSSL::SSL::SSLContext::METHODS.select do |method|
agent = Mechanize.new
agent.ssl_version = method
debug "Testing SSL method: #{method}"
begin
agent.get(base)
rescue => e
false
end
end
debug 'These are the working SSL methods: ' + working.join(', ')
exit
end

def main
test_ssl_methods
# Set an API key if provided
Geokit::Geocoders::GoogleGeocoder.api_key = config.google.api_key
records = new_convictions
Expand Down

0 comments on commit 938702c

Please sign in to comment.