Skip to content

Commit

Permalink
don't raise error in get if certificate is empty
Browse files Browse the repository at this point in the history
Signed-off-by: rishichawda <[email protected]>
  • Loading branch information
rishichawda committed Sep 7, 2021
1 parent 133e497 commit 0ba600f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/win32/certstore/store_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,8 @@ def cert_get(certificate_thumbprint, store_name:, store_location:)
thumbprint = update_thumbprint(certificate_thumbprint)
cert_pem = get_cert_pem(thumbprint, store_name: store_name, store_location: store_location)
cert_pem = format_pem(cert_pem)
if cert_pem.empty?
raise ArgumentError, "Unable to retrieve the certificate"
end

unless cert_pem.empty?
build_openssl_obj(cert_pem)
end
cert_pem.empty? ? cert_pem : build_openssl_obj(cert_pem)
end

# Listing certificate of open certstore and return list in json
Expand Down

0 comments on commit 0ba600f

Please sign in to comment.