Skip to content

Commit

Permalink
[match] suppress null byte message (#20497)
Browse files Browse the repository at this point in the history
  • Loading branch information
getaaron committed Jul 22, 2022
1 parent 0781d7e commit c6ef9b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions match/lib/match/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ def self.environment_variable_name_certificate_name(app_identifier: nil, type: n

def self.get_cert_info(cer_certificate)
# can receive a certificate path or the file data
if File.exist?(cer_certificate)
cer_certificate = File.binread(cer_certificate)
begin
if File.exist?(cer_certificate)
cer_certificate = File.binread(cer_certificate)
end
rescue ArgumentError
# cert strings have null bytes; suppressing output
end

cert = OpenSSL::X509::Certificate.new(cer_certificate)

# openssl output:
Expand Down

0 comments on commit c6ef9b1

Please sign in to comment.