http://qs1969.pair.com?node_id=11144497

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

TLDR; Needed to install libz ( apt install zlib1g-dev )

I'm brand new to perl, and I have been having a very hard time getting Net::SSLeay installed. It seems Net::SSLeay is a prerequisite for almost anything that does https. (I tried a few other packages and they tried to install Net::SSLeay).

I'm working in a Ununtu 20:04 docker container (so I won't mess up my main workstation), and I installed the following in the container:

adduser linux apt install sudo usermod -aG sudo linux apt install build-essential apt install openssl apt install libssl-dev apt install curl apt install vim apt install less sudo apt install cpanminus As user linux sudo cpanm Data::Dump sudo cpanm Net::HTTPS sudo cpanm LWP::UserAgent

Everything was fine until I tried to use LWP::UserAgent - It complained that I needed LWP::Protocol::https , and when I tried to install it I got errors relating to Net::SSLeay . I tried to install Net::SSLeay by itself and go tthe folowing:

Any assistance would be much appreciated -- if I should be using different modules that's OK, I'm just looking for a good way to do https. For a Noob the library is very hard to navigate, but it appears that LWP::UserAgent is an up-to-date and maintained module.

linux@d5b09b80fca4:~$ sudo cpanm Net::SSLeay [sudo] password for linux: --> Working on Net::SSLeay Fetching http://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.92.ta +r.gz ... OK Configuring Net-SSLeay-1.92 ... OK Building and testing Net-SSLeay-1.92 ... FAIL ! Installing Net::SSLeay failed. See /root/.cpanm/work/1654642332.7274 +/build.log for details. Retry with --force to force install it. linux@d5b09b80fca4:~$ less Missing filename ("less --help" for help) linux@d5b09b80fca4:~$ sudo less /root/.cpanm/work/1654642332.7274/buil +d.log linux@d5b09b80fca4:~$ sudo cat /root/.cpanm/work/1654642332.7274/buil +d.log cpanm (App::cpanminus) 1.7044 on perl 5.030000 built for x86_64-linux- +gnu-thread-multi Work directory is /root/.cpanm/work/1654642332.7274 You have make /usr/bin/make You have LWP 6.66 You have /usr/bin/tar: tar (GNU tar) 1.30 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/g +pl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. Searching Net::SSLeay () on cpanmetadb ... --> Working on Net::SSLeay Fetching http://www.cpan.org/authors/id/C/CH/CHRISN/Net-SSLeay-1.92.ta +r.gz -> OK Unpacking Net-SSLeay-1.92.tar.gz Entering Net-SSLeay-1.92 Checking configure dependencies from META.json Checking if you have constant 0 ... Yes (1.33) Checking if you have File::Spec::Functions 0 ... Yes (3.78) Checking if you have English 0 ... Yes (1.10) Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34) Checking if you have Text::Wrap 0 ... Yes (2013.0523) Configuring Net-SSLeay-1.92 Running Makefile.PL Do you want to run external tests? These tests *will* *fail* if you do not have network connectivity. [n] + n *** Be sure to use the same compiler and options to compile your OpenS +SL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. *** Found OpenSSL-1.1.1f installed in /usr Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Net::SSLeay Writing MYMETA.yml and MYMETA.json -> OK Checking dependencies from MYMETA.json ... Checking if you have English 0 ... Yes (1.10) Checking if you have base 0 ... Yes (2.27) Checking if you have Storable 0 ... Yes (3.15) Checking if you have File::Basename 0 ... Yes (2.85) Checking if you have File::Spec::Functions 0 ... Yes (3.78) Checking if you have Cwd 0 ... Yes (3.78) Checking if you have Test::Builder 0 ... Yes (1.302162) Checking if you have Test::More 0.60_01 ... Yes (1.302162) Checking if you have MIME::Base64 0 ... Yes (3.15) Checking if you have Carp 0 ... Yes (1.50) Checking if you have Scalar::Util 0 ... Yes (1.50) Checking if you have Config 0 ... Yes (5.030000) Checking if you have SelectSaver 0 ... Yes (1.02) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34) Checking if you have Socket 0 ... Yes (2.027) Building and testing Net-SSLeay-1.92 cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay) blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 +characters: directory blib/lib/auto/Net/SSLeay: do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do +_https do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.a +l, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate +to get_http head_https.al, head_https3.al, head_https4.al, head_http.al, head_ht +tp3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al +truncate to head_htt post_https.al, post_https3.al, post_https4.al, post_http.al, post_ht +tp3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al +truncate to post_htt put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.a +l, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate +to put_http ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl +_read ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp +_read tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm Running Mkbootstrap for SSLeay () chmod 644 "SSLeay.bs" "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SSLeay.bs +blib/arch/auto/Net/SSLeay/SSLeay.bs 644 "/usr/bin/perl" "/usr/share/perl/5.30/ExtUtils/xsubpp" -typemap '/usr +/share/perl/5.30/ExtUtils/typemap' -typemap '/root/.cpanm/work/165464 +2332.7274/Net-SSLeay-1.92/typemap' SSLeay.xs > SSLeay.xsc mv SSLeay.xsc SSLeay.c x86_64-linux-gnu-gcc -c -I"/usr/include" -D_REENTRANT -D_GNU_SOURCE - +DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LA +RGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"1.92\" -DX +S_VERSION=\"1.92\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.30/CORE" + SSLeay.c SSLeay.xs: In function 'XS_Net__SSLeay_CTX_tlsv1_new': SSLeay.xs:2088:6: warning: 'TLSv1_method' is deprecated [-Wdeprecated- +declarations] 2088 | RETVAL = SSL_CTX_new (TLSv1_method()); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1877:1: note: declared here 1877 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void) +) /* TLSv1.0 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_CTX_tlsv1_1_new': SSLeay.xs:2097:6: warning: 'TLSv1_1_method' is deprecated [-Wdeprecate +d-declarations] 2097 | RETVAL = SSL_CTX_new (TLSv1_1_method()); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1883:1: note: declared here 1883 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(voi +d)) /* TLSv1.1 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_CTX_tlsv1_2_new': SSLeay.xs:2108:6: warning: 'TLSv1_2_method' is deprecated [-Wdeprecate +d-declarations] 2108 | RETVAL = SSL_CTX_new (TLSv1_2_method()); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1889:1: note: declared here 1889 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(voi +d)) /* TLSv1.2 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_RAND_pseudo_bytes': SSLeay.xs:3302:9: warning: 'RAND_pseudo_bytes' is deprecated [-Wdeprec +ated-declarations] 3302 | rc = RAND_pseudo_bytes(random, num); | ^~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/rand.h:44:1: note: declared here 44 | DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, i +nt num)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_X509_CRL_get_lastUpdate': SSLeay.c:7438:2: warning: 'X509_CRL_get_lastUpdate' is deprecated [-Wd +eprecated-declarations] 7438 | RETVAL = X509_CRL_get_lastUpdate(x); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/x509.h:727:1: note: declared here 727 | DEPRECATEDIN_1_1_0(ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL + *crl)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_X509_CRL_get_nextUpdate': SSLeay.c:7457:2: warning: 'X509_CRL_get_nextUpdate' is deprecated [-Wd +eprecated-declarations] 7457 | RETVAL = X509_CRL_get_nextUpdate(x); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/x509.h:728:1: note: declared here 728 | DEPRECATEDIN_1_1_0(ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL + *crl)) | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_X509_get_subjectAltNames': SSLeay.xs:4060:26: warning: 'ASN1_STRING_data' is deprecated [-Wdeprec +ated-declarations] 4060 | PUSHs(sv_2mortal(newSVpv((const char* +)ASN1_STRING_data(subjAltNameDN->d.otherName->value->value.utf8string +), ASN1_STRING_length(subjAltNameDN->d.otherName->value->value.utf8st +ring)))); | ^~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/asn1.h:554:1: note: declared here 554 | DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING + *x)) | ^~~~~~~~~~~~~~~~~~ SSLeay.xs:4069:26: warning: 'ASN1_STRING_data' is deprecated [-Wdeprec +ated-declarations] 4069 | PUSHs(sv_2mortal(newSVpv((const char* +)ASN1_STRING_data(subjAltNameDN->d.ia5), ASN1_STRING_length(subjAltNa +meDN->d.ia5)))); | ^~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/asn1.h:554:1: note: declared here 554 | DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING + *x)) | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_P_X509_get_crl_distribution_poi +nts': SSLeay.xs:4133:25: warning: 'ASN1_STRING_data' is deprecated [-Wdeprec +ated-declarations] 4133 | XPUSHs(sv_2mortal(newSVpv((char*)ASN1_ +STRING_data(gn->d.ia5),ASN1_STRING_length(gn->d.ia5)))); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/asn1.h:554:1: note: declared here 554 | DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING + *x)) | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_P_X509_get_ocsp_uri': SSLeay.xs:4174:3: warning: 'ASN1_STRING_data' is deprecated [-Wdepreca +ted-declarations] 4174 | XPUSHs(sv_2mortal(newSVpv( | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/asn1.h:554:1: note: declared here 554 | DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING + *x)) | ^~~~~~~~~~~~~~~~~~ SSLeay.xs: In function 'XS_Net__SSLeay_P_ASN1_STRING_get': SSLeay.xs:4524:9: warning: 'ASN1_STRING_data' is deprecated [-Wdepreca +ted-declarations] 4524 | u8 = newSVpv((const char*)ASN1_STRING_data(s), ASN1_ST +RING_length(s)); | ^~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/asn1.h:554:1: note: declared here 554 | DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING + *x)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_method': SSLeay.c:10722:2: warning: 'TLSv1_method' is deprecated [-Wdeprecated- +declarations] 10722 | RETVAL = TLSv1_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1877:1: note: declared here 1877 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_method(void) +) /* TLSv1.0 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_server_method': SSLeay.c:10739:2: warning: 'TLSv1_server_method' is deprecated [-Wdepr +ecated-declarations] 10739 | RETVAL = TLSv1_server_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1878:1: note: declared here 1878 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_server_metho +d(void)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_client_method': SSLeay.c:10756:2: warning: 'TLSv1_client_method' is deprecated [-Wdepr +ecated-declarations] 10756 | RETVAL = TLSv1_client_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1879:1: note: declared here 1879 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_client_metho +d(void)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_1_method': SSLeay.c:10776:2: warning: 'TLSv1_1_method' is deprecated [-Wdeprecate +d-declarations] 10776 | RETVAL = TLSv1_1_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1883:1: note: declared here 1883 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_method(voi +d)) /* TLSv1.1 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_1_server_method': SSLeay.c:10793:2: warning: 'TLSv1_1_server_method' is deprecated [-Wde +precated-declarations] 10793 | RETVAL = TLSv1_1_server_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1884:1: note: declared here 1884 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_server_met +hod(void)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_1_client_method': SSLeay.c:10810:2: warning: 'TLSv1_1_client_method' is deprecated [-Wde +precated-declarations] 10810 | RETVAL = TLSv1_1_client_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1885:1: note: declared here 1885 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_1_client_met +hod(void)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_2_method': SSLeay.c:10831:2: warning: 'TLSv1_2_method' is deprecated [-Wdeprecate +d-declarations] 10831 | RETVAL = TLSv1_2_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1889:1: note: declared here 1889 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_method(voi +d)) /* TLSv1.2 */ | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_2_server_method': SSLeay.c:10848:2: warning: 'TLSv1_2_server_method' is deprecated [-Wde +precated-declarations] 10848 | RETVAL = TLSv1_2_server_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1890:1: note: declared here 1890 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_server_met +hod(void)) | ^~~~~~~~~~~~~~~~~~ SSLeay.c: In function 'XS_Net__SSLeay_TLSv1_2_client_method': SSLeay.c:10865:2: warning: 'TLSv1_2_client_method' is deprecated [-Wde +precated-declarations] 10865 | RETVAL = TLSv1_2_client_method(); | ^~~~~~ In file included from /usr/include/openssl/e_os2.h:13, from /usr/include/openssl/err.h:13, from SSLeay.xs:163: /usr/include/openssl/ssl.h:1891:1: note: declared here 1891 | DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *TLSv1_2_client_met +hod(void)) | ^~~~~~~~~~~~~~~~~~ rm -f blib/arch/auto/Net/SSLeay/SSLeay.so x86_64-linux-gnu-gcc -shared -L/usr -L/usr/lib64 -L/usr/lib -L/usr/lo +cal/lib -fstack-protector-strong SSLeay.o -o blib/arch/auto/Net/SSL +eay/SSLeay.so \ -L/usr -L/usr/lib64 -L/usr/lib -lssl -lcrypto -lz \ /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status make: *** [Makefile:494: blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1 -> FAIL Installing Net::SSLeay failed. See /root/.cpanm/work/165464233 +2.7274/build.log for details. Retry with --force to force install it.