Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use cacert.pem for HTTPS connections

If not exist, do not verify cert at all
  • Loading branch information...
commit 0d02ff8c78bf773e28bc6c4f97d8cb4185bd9c33 1 parent afa451d
@voxik voxik authored luislavena committed
View
6 config/ruby_installer.rb
@@ -9,6 +9,12 @@ module RubyInstaller
SEVEN_ZIP = File.expand_path(File.join(ROOT, 'sandbox', 'extract_utils', '7za.exe'))
BSD_TAR = File.expand_path(File.join(ROOT, 'sandbox', 'extract_utils', 'basic-bsdtar.exe'))
+ # SSL Certificates
+ Certificate = OpenStruct.new(
+ :url => 'http://curl.haxx.se/ca',
+ :file => 'cacert.pem'
+ )
+
# MinGW files
MinGW = OpenStruct.new(
:release => 'current',
View
7 rake/contrib/uri_ext.rb
@@ -285,8 +285,13 @@ def connect
http = Net::HTTP.new(host, port)
end
if self.instance_of? URI::HTTPS
+ cacert = "downloads/#{RubyInstaller::Certificate.file}"
http.use_ssl = true
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ if File.exist?(cacert)
+ http.ca_file = cacert
+ else
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ end
end
yield http
end
View
12 recipes/certificate.rake
@@ -0,0 +1,12 @@
+namespace :certificate do
+ cert = RubyInstaller::Certificate
+
+ source = "#{cert.url}/#{cert.file}"
+ target = "downloads/#{cert.file}"
+
+ download target => source
+ task :download => target
+end
+
+task :certificate => ['certificate:download']
+task :downloads => [:certificate]
Please sign in to comment.
Something went wrong with that request. Please try again.