Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit e29a3a09a36d3dfc0448430cc7d767c3a64c6339 2 parents fb38baf + 5ab5fb9
John Barnette authored

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. +6 4 lib/vines/store.rb
10 lib/vines/store.rb
@@ -43,10 +43,12 @@ def certs
43 43 unless @@sources
44 44 pattern = /-{5}BEGIN CERTIFICATE-{5}\n.*?-{5}END CERTIFICATE-{5}\n/m
45 45 pairs = Dir[File.join(@dir, '*.crt')].map do |name|
46   - pems = File.read(name).scan(pattern)
47   - certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
48   - certs.reject! {|cert| cert.not_after < Time.now }
49   - [name, certs]
  46 + File.open(name, "r:UTF-8") do |f|
  47 + pems = f.read.scan(pattern)
  48 + certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
  49 + certs.reject! {|cert| cert.not_after < Time.now }
  50 + [name, certs]
  51 + end
50 52 end
51 53 @@sources = Hash[pairs]
52 54 end

0 comments on commit e29a3a0

Please sign in to comment.
Something went wrong with that request. Please try again.