Skip to content

Commit

Permalink
Fix number used for SSLEAY_DIR/OPENSSL_DIR since this changed with Op…
Browse files Browse the repository at this point in the history
…enSSL 1.1.

This caused it to not find the default path for CA any longer with OpenSSL 1.1.
  • Loading branch information
noxxi committed Dec 17, 2016
1 parent 32ddca6 commit 8c81f60
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/IO/Socket/SSL.pm
Expand Up @@ -450,8 +450,13 @@ my $CHECK_SSL_PATH = sub {
}
return %default_ca if defined $ca_detected;

$openssldir ||= Net::SSLeay::SSLeay_version(5)
=~m{^OPENSSLDIR: "(.+)"$} && $1 || '';
# SSLEAY_DIR was 5 up to OpenSSL 1.1, then switched to 4 and got
# renamed to OPENSSL_DIR. Unfortunately it is not exported as constant
# by Net::SSLeay so we use the fixed number.
$openssldir ||=
Net::SSLeay::SSLeay_version(5) =~m{^OPENSSLDIR: "(.+)"$} ? $1 :
Net::SSLeay::SSLeay_version(4) =~m{^OPENSSLDIR: "(.+)"$} ? $1 :
'cannot-determine-openssldir-from-ssleay-version';

# (re)detect according to openssl crypto/cryptlib.h
my $dir = $ENV{SSL_CERT_DIR}
Expand Down

0 comments on commit 8c81f60

Please sign in to comment.