Permalink
Browse files

Merge remote-tracking branch 'origin/tests' into core

  • Loading branch information...
2 parents fb38baf + 5ab5fb9 commit e29a3a09a36d3dfc0448430cc7d767c3a64c6339 @jbarnette committed Sep 11, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/vines/store.rb
View
10 lib/vines/store.rb
@@ -43,10 +43,12 @@ def certs
unless @@sources
pattern = /-{5}BEGIN CERTIFICATE-{5}\n.*?-{5}END CERTIFICATE-{5}\n/m
pairs = Dir[File.join(@dir, '*.crt')].map do |name|
- pems = File.read(name).scan(pattern)
- certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
- certs.reject! {|cert| cert.not_after < Time.now }
- [name, certs]
+ File.open(name, "r:UTF-8") do |f|
+ pems = f.read.scan(pattern)
+ certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
+ certs.reject! {|cert| cert.not_after < Time.now }
+ [name, certs]
+ end
end
@@sources = Hash[pairs]
end

0 comments on commit e29a3a0

Please sign in to comment.