sannag has asked for the wisdom of the Perl Monks concerning the following question:

**************************************************

Update: The Fix

I have a fix on this, here is the solution. Thank you all for your assistance.

Steps as I followed Install the Openssl in a local directory. cd /usr/local/src wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz # gett +ing the openssl package tar -zxf openssl-1.0.2-latest.tar.gz Make and install Openssl cd openssl-1.0.2a ./config make make test make install # moved old openssl and created openssl with symbolic link mv /usr/bin/openssl /root/ ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl At this point when I re-ran 'perl MakeFile.PL' and 'make test' for Net +::SSLeay. I get the error can't find err.h file, to have it resloved I created a symbolic like on where look for .h files as following. cd /usr/local/include ln -s /usr/local/ssl/include/openssl At this point I re-ran 'perl MakeFile.PL' for Net::SSLeay. Not it say /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status I went ahead and installed openssl-devel package 'yum install openssl- +devel'

At this point when I re-ran 'perl MakeFile.PL' and 'make test' for Net::SSLeay, it was a sucess. There is a chance you might just need openssl-devel development package (no need for openssl source package).

*************************************************

Please bear with me as my perl and linux skills are limited. I am trying to install and REST::Client module on Redhat Linux 8.0 and it fails with below errors. After reading an article on perlmonks I installed OpenSSL

yum install openssl (I only installed it but did not set any configuration)

still cpan install of REST::Client fails. What am I doing wrong?

Any Help is greatly appreciated. Just as a side note I am using perlV5.16.3
SULLR/IO-Socket-SSL-2.049.tar.gz one dependency not OK (Net::SSLeay); additionally test harness failed /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports SULLR/IO-Socket-SSL-2.049.tar.gz OALDERS/LWP-Protocol-https-6.07.tar.gz Has already been unwrapped into directory /root/.cpan/build/LWP-Prot +ocol-https-6.07-0 OALDERS/LWP-Protocol-https-6.07.tar.gz Has already been prepared Running make for O/OA/OALDERS/LWP-Protocol-https-6.07.tar.gz Warning: Prerequisite 'IO::Socket::SSL => 1.54' for 'OALDERS/LWP-Proto +col-https-6.07.tar.gz' failed when processing 'SULLR/IO-Socket-SS +L-2.049.tar.gz' with 'make_test => NO one dependency not OK (Net: +:SSLeay); additionally test harness failed'. Continuing, but chances +to succeed are limited. cp lib/LWP/Protocol/https.pm blib/lib/LWP/Protocol/https.pm Manifying 1 pod document OALDERS/LWP-Protocol-https-6.07.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Har ness::Switches; test_harness(0, 'bl +ib/lib', 'blib/arch')" t/*.t t/apache.t ....... ok t/https_proxy.t .. skipped: no recent version of IO::Socket::SSL::Util +s All tests successful. Files=2, Tests=5, 2 wallclock secs ( 0.05 usr 0.01 sys + 0.58 cusr + 0.06 csys = 0.70 CPU) Result: PASS OALDERS/LWP-Protocol-https-6.07.tar.gz Tests succeeded but one dependency not OK (IO::Socket::SSL) OALDERS/LWP-Protocol-https-6.07.tar.gz [dependencies] -- NA KKANE/REST-Client-273.tar.gz Has already been unwrapped into directory /root/.cpan/build/REST-Cli +ent-273-0 KKANE/REST-Client-273.tar.gz Has already been prepared Running make for K/KK/KKANE/REST-Client-273.tar.gz Warning: Prerequisite 'LWP::Protocol::https => 0' for 'KKANE/REST-Clie +nt-273.tar.gz' failed when pro cessing 'OALDERS/LWP-Protocol-https +-6.07.tar.gz' with 'make_test => NO one dependency not OK (IO::So +cket::SSL)'. Continuing, but chances to succeed are limited. KKANE/REST-Client-273.tar.gz Tests succeeded but one dependency not OK (LWP::Protocol::https) KKANE/REST-Client-273.tar.gz [dependencies] -- NA Failed during this command: MIKEM/Net-SSLeay-1.81.tar.gz : make NO SULLR/IO-Socket-SSL-2.049.tar.gz : make_test NO one depen +dency not OK (Net::SSLeay); ad ditionally test harness failed OALDERS/LWP-Protocol-https-6.07.tar.gz : make_test NO one depen +dency not OK (IO::Socket::SSL) KKANE/REST-Client-273.tar.gz : make_test NO one depen +dency not OK (LWP::Protocol::h ttps)

Replies are listed 'Best First'.
Re: Errors Installing REST::Client
by marto (Cardinal) on Aug 08, 2017 at 21:31 UTC

    Welcome. Net::SSLeay isn't installing. If you look at the README it states that the openssl devel should be installed, as per the prerequisites section.

    When an automated module installation fails you should read the documentation for the modules which cause the failure. This includes open issues as well as the associated README/INSTALL files.

    Try the above, install the devel package using your package manager, then try to install REST::Client. Report back any problems.

      Thank you very much! I will try it out and post results back here

      I still can’t install the Net::SSLeay. The got past the original error. Here is what I have tried.

      First installed openssl and recompiled cd /usr/local/src wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz # gett +ing the openssl package tar -zxf openssl-1.0.2-latest.tar.gz # compiled and installed it. cd openssl-1.0.2a ./config make make test make install # moved old openssl and created openssl with symbolic link mv /usr/bin/openssl /root/ ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

      At this point when I re-ran 'perl MakeFile.PL' and 'make test' for Net::SSLeay. I get the error can't find err.h file, to have it resolved. I created a symbolic like on where look for .h files as following.

      cd /usr/local/include ln -s /usr/local/ssl/include/openssl At this point I re-ran 'perl MakeFile.PL' for Net::SSLeay. Now it say /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status Here is full notes # make test Running Mkbootstrap for SSLeay () chmod 644 "SSLeay.bs" "/usr/bin/perl" "-Iinc" -MExtUtils::Command::MM -e 'cp_nonempty' -- SS +Leay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs 644 gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack +-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BI +TS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack +-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m6 +4 -mtune=generic -DVERSION=\"1.81\" -DXS_VERSION=\"1.81\" -fPIC "-I +/usr/lib64/perl5/CORE" SSLeay.c SSLeay.xs: In function ‘ssleay_ctx_cert_verify_cb_invoke’: SSLeay.xs:675:10: warning: variable ‘ssl’ set but not used [-Wunused-b +ut-set-variable] SSL *ssl; ^ SSLeay.xs: In function ‘next_proto_select_cb_invoke’: SSLeay.xs:917:12: warning: unused variable ‘n_a’ [-Wunused-variable] STRLEN n_a; ^ SSLeay.xs: In function ‘pem_password_cb_invoke’: SSLeay.xs:1116:12: warning: unused variable ‘n_a’ [-Wunused-variable] STRLEN n_a; ^ SSLeay.xs: In function ‘tlsext_ticket_key_cb_invoke’: SSLeay.xs:1288:2: warning: pointer targets in passing argument 2 of ‘P +erl_newSVpv’ differ in signedness [-Wpointer-sign] XPUSHs(sv_2mortal(newSVpv(key_name,16))); ^ In file included from /usr/lib64/perl5/CORE/perl.h:5030:0, from SSLeay.xs:141: /usr/lib64/perl5/CORE/proto.h:2755:19: note: expected ‘const char * co +nst’ but argument is of type unsigned char *’ PERL_CALLCONV SV* Perl_newSVpv(pTHX_ const char *const s, const STRLE +N len) ^ In file included from /usr/lib64/perl5/CORE/perl.h:3436:0, from SSLeay.xs:141: /usr/lib64/perl5/CORE/sv.h:1567:5: warning: pointer targets in initial +ization differ in signedness [-Wpointer-sign] ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ^ /usr/lib64/perl5/CORE/sv.h:1562:22: note: in expansion of macro ‘SvPV_ +flags’ #define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC) ^ SSLeay.xs:1306:29: note: in expansion of macro ‘SvPV’ unsigned char *pname = SvPV(sname,svlen); ^ /usr/lib64/perl5/CORE/sv.h:1567:5: warning: pointer targets in initial +ization differ in signedness [-Wpointer-sign] ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ^ /usr/lib64/perl5/CORE/sv.h:1562:22: note: in expansion of macro ‘SvPV_ +flags’ #define SvPV(sv, lp) SvPV_flags(sv, lp, SV_GMAGIC) ^ SSLeay.xs:1319:28: note: in expansion of macro ‘SvPV’ unsigned char *pkey = SvPV(skey,svlen); ^ In file included from SSLeay.xs:142:0: SSLeay.c: In function ‘XS_Net__SSLeay_CLONE’: /usr/lib64/perl5/CORE/XSUB.h:164:20: warning: unused variable ‘items’ +[-Wunused-variable] #define dITEMS I32 items = (I32)(SP - MARK) ^ /usr/lib64/perl5/CORE/XSUB.h:172:16: note: in expansion of macro ‘dITE +MS’ dSP; dAXMARK; dITEMS ^ SSLeay.c:1632:11: note: in expansion of macro ‘dXSARGS’ dVAR; dXSARGS; ^ SSLeay.c: In function ‘XS_Net__SSLeay_read’: SSLeay.c:2403:7: warning: unused variable ‘RETVAL’ [-Wunused-variable] AV * RETVAL; ^ SSLeay.c: In function ‘XS_Net__SSLeay_get_shared_ciphers’: SSLeay.c:3156:6: warning: variable ‘ignored_param2’ set but not used [ +-Wunused-but-set-variable] int ignored_param2; ^ SSLeay.c:3155:6: warning: variable ‘ignored_param1’ set but not used [ +-Wunused-but-set-variable] int ignored_param1; ^ In file included from SSLeay.xs:142:0: SSLeay.c: In function ‘XS_Net__SSLeay_get_session’: /usr/lib64/perl5/CORE/XSUB.h:183:20: warning: unused variable ‘ix’ [-W +unused-variable] #define dXSI32 I32 ix = XSANY.any_i32 ^ SSLeay.c:3476:5: note: in expansion of macro ‘dXSI32’ dXSI32; ^ SSLeay.c: In function ‘XS_Net__SSLeay_FIPS_mode_set’: SSLeay.c:4410:6: warning: unused variable ‘onoff’ [-Wunused-variable] int onoff = (int)SvIV(ST(0)) ^ In file included from SSLeay.xs:142:0: SSLeay.c: In function ‘XS_Net__SSLeay_library_init’: /usr/lib64/perl5/CORE/XSUB.h:183:20: warning: unused variable ‘ix’ [-W +unused-variable] #define dXSI32 I32 ix = XSANY.any_i32 ^ SSLeay.c:4441:5: note: in expansion of macro ‘dXSI32’ dXSI32; ^ SSLeay.c: In function ‘XS_Net__SSLeay_P_ASN1_TIME_put2string’: /usr/lib64/perl5/CORE/XSUB.h:183:20: warning: unused variable ‘ix’ [-W +unused-variable] #define dXSI32 I32 ix = XSANY.any_i32 ^ SSLeay.c:7802:5: note: in expansion of macro ‘dXSI32’ dXSI32; ^ SSLeay.xs: In function ‘XS_Net__SSLeay_get_keyblock_size’: SSLeay.xs:5218:16: warning: unused variable ‘h’ [-Wunused-variable] const EVP_MD *h; ^ In file included from /usr/lib64/perl5/CORE/perl.h:5071:0, from SSLeay.xs:141: SSLeay.c: In function ‘XS_Net__SSLeay_OCSP_response_results’: /usr/lib64/perl5/CORE/embed.h:203:62: warning: ‘revocationTime’ may be + used uninitialized in this function [-Wmaybe-uninitialized] #define hv_common_key_len(a,b,c,d,e,f) Perl_hv_common_key_len(aTHX_ a +,b,c,d,e,f) ^ SSLeay.xs:6103:28: note: ‘revocationTime’ was declared here ASN1_GENERALIZEDTIME *revocationTime, *thisupdate, *nextupdate; ^ rm -f blib/arch/auto/Net/SSLeay/SSLeay.so LD_RUN_PATH="/usr/lib64" gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIF +Y_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-s +ize=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro SSLeay +.o -o blib/arch/auto/Net/SSLeay/SSLeay.so \ -L/usr -L/usr/lib64 -L/usr/lib -lssl -lcrypto -lz \ /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status make: *** [blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1

        Excuse the late reply, installing openssl-devel via your package manager (as explained in the module README) will satisfy any required dependencies, then try reinstalling the perl module from cpan.

Re: Errors Installing REST::Client
by hippo (Archbishop) on Aug 08, 2017 at 22:42 UTC
    I am trying to install and REST::Client module on Redhat Linux 8.0

    Wow, that's one extremely old operating system. It might save you a whole bunch of headaches in the long run just to replace the O/S with something that's still supported instead. Just a thought.

      Sorry must clarify using RHEL 7.2 https://access.redhat.com/articles/3078
Re: Errors Installing REST::Client
by scorpio17 (Canon) on Aug 09, 2017 at 13:52 UTC
    Another "gotcha" you might need to watch out for - sometimes you need to install the "developer" version of a library, in order to get the header files that other installers are going to need later. For example, "yum install openssl-devel" (same for any other libs you may depend on).

      Thank you! yes it did complain about headers fles like it can't find err.h file. To have it resolved I created a symbolic like on where look for .h files as following. Though I don't have .h file errors any more I had other issues (as mentioned in one the reply above)

      cd /usr/local/include ln -s /usr/local/ssl/include/openssl