mirror of
git://git.proxmox.com/git/pve-apiclient.git
synced 2024-12-22 17:34:22 +03:00
cleanup Net::SSLeay error handling
X509_get_fingerprint does not die - it only returns undef in case of errors (or segfaults if the $cert pointer is invalid).
This commit is contained in:
parent
adbda0b73e
commit
1d40f3c38c
@ -258,11 +258,8 @@ my $verify_cert_callback = sub {
|
||||
|
||||
# check server certificate against cache of pinned FPs
|
||||
# get fingerprint of server certificate
|
||||
my $fp;
|
||||
eval {
|
||||
$fp = Net::SSLeay::X509_get_fingerprint($cert, 'sha256');
|
||||
};
|
||||
return 0 if $@ || !defined($fp) || $fp eq ''; # error
|
||||
my $fp = Net::SSLeay::X509_get_fingerprint($cert, 'sha256');
|
||||
return 0 !defined($fp) || $fp eq ''; # error
|
||||
|
||||
my $valid = $self->{cached_fingerprints}->{$fp};
|
||||
return $valid if defined($valid); # return cached result
|
||||
|
Loading…
Reference in New Issue
Block a user