lib/oddb2xml/downloader.rb in oddb2xml-1.4.0 vs lib/oddb2xml/downloader.rb in oddb2xml-1.4.1

- old
+ new

@@ -36,9 +36,15 @@ @agent = Mechanize.new @agent.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0' @agent.redirect_ok = true @agent.redirection_limit = 5 @agent.follow_meta_refresh = true + if RUBY_PLATFORM =~ /mswin|mingw|bccwin|cygwin/i and + ENV['SSL_CERT_FILE'].nil? + cert_store = OpenSSL::X509::Store.new + cert_store.add_file(File.expand_path('../../../tools/cacert.pem', __FILE__)) + @agent.cert_store = cert_store + end end protected def retrievable? if @retry_times > 0 sleep 5