Reputation: 7364
When trying to install Crypt::SSLeay
on Mac OS X I get the following error:
$ sudo perl -MCPAN -e shell
cpan[1]> install Crypt::SSLeay
Reading '/Users/.cpan/Metadata'
Database was generated on Thu, 26 Oct 2017 01:53:54 GMT
Running install for module 'Crypt::SSLeay'
Running make for N/NA/NANIS/Crypt-SSLeay-0.72.tar.gz
Checksum for /Users/.cpan/sources/authors/id/N/NA/NANIS/Crypt-SSLeay-0.72.tar.gz ok
Scanning cache /Users/.cpan/build for sizes
............................................................................DONE
CPAN.pm: Building N/NA/NANIS/Crypt-SSLeay-0.72.tar.gz
Cannot link with any of the requested SSL libraries 'ssl, crypto, ssl32, ssleay32, eay32, libeay32, z'
No 'Makefile' created'YAML' not installed, will not store persistent state
NANIS/Crypt-SSLeay-0.72.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
NANIS/Crypt-SSLeay-0.72.tar.gz : writemakefile NO -- No 'Makefile' created
I have installed openssl as per the instructions found here and the output of openssl version -a
is:
OpenSSL 1.1.0f 25 May 2017
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
compiler: cc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/mac-dev-env/openssl-1.1.0f/ssl\"" -DENGINESDIR="\"/usr/local/mac-dev-env/openssl-1.1.0f/lib/engines-1.1\""
OPENSSLDIR: "/usr/local/mac-dev-env/openssl-1.1.0f/ssl"
ENGINESDIR: "/usr/local/mac-dev-env/openssl-1.1.0f/lib/engines-1.1"
I'm not sure what else I can do, as I have the ssl library required but it doesn't seem to link it?
Upvotes: 0
Views: 3204
Reputation: 11
As stated above, in README it's mentioned "--incpath" and "--libpath" to use custom paths to your openssl instalation.
So it should be something like this (Note:check your openssl version, in this example it's 1.1.1d):
$ sudo perl Makefile.PL --incpath="/usr/local/Cellar/[email protected]/1.1.1d/include" --libpath="/usr/local/Cellar/[email protected]/1.1.1d/lib"
I struggled to understand what path should be used on those parameters. Those worked though.
Upvotes: 1
Reputation: 954
If this is related to installing LWP::Protocol::https
, because you wanted to use LWP::UserAgent
... you will be bettor off installing: IO::Socket::SSL
instead off aforementioned Crypt::SSLeay
Upvotes: 1
Reputation: 123320
OPENSSLDIR: "/usr/local/mac-dev-env/openssl-1.1.0f/ssl"
This is not a standard location for openssl. Which explains why it cannot find the necessary files:
Cannot link with any of the requested SSL libraries 'ssl, crypto, ssl32, ssleay32, eay32, libeay32, z'
When looking at the README for Crypt::SSLeay you will find:
If you have OpenSSL headers and libraries in nonstandard locations, you can use
$ perl Makefile.PL --incpath=... --libpath=...
There are further instructions in the README how to set the path when using cpanm etc.
Apart from that, in most cases you don't want to install Crypt::SSLeay but instead Net::SSLeay. Crypt::SSLeay is only supported to keep older versions of LWP working, all newer things (including current versions of LWP) use Net::SSLeay and IO::Socket::SSL on top of Net::SSLeay.
Upvotes: 3