mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-06-01 00:00:30 -04:00
Our CA bundle has fallen quite out of date since it was last pulled. This patch updates it and adds a Rake task to make this task more repeatable. One thing worth noting is I've switched us over from the Ubuntu bundle to the Mozilla bundle that's maintained by cURL. The bundle seemed to be previously extracted by a custom script that I don't really want to maintain. cURL and Excon both use the Mozilla bundle and it should be a safe replacement.
18 lines
500 B
Ruby
18 lines
500 B
Ruby
require 'rake/testtask'
|
|
|
|
task :default => [:test]
|
|
|
|
Rake::TestTask.new do |t|
|
|
t.pattern = './test/**/*_test.rb'
|
|
end
|
|
|
|
desc "update bundled certs"
|
|
task :update_certs do
|
|
require "restclient"
|
|
File.open(File.join(File.dirname(__FILE__), 'lib', 'data', 'ca-certificates.crt'), 'w') do |file|
|
|
resp = RestClient.get "https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt"
|
|
abort("bad response when fetching bundle") unless resp.code == 200
|
|
file.write(resp.to_str)
|
|
end
|
|
end
|