Perl HTTPS support

If you get errors like
  • Missing LWP::Protocol::https
  • Connection reset by peer
  • SSL negotiation failed
then follow this docu, follow your platform where is running your STOR2RRD server

AIX

  • These 2 packages are mandatory!
    # rpm -qa | egrep -i "Crypt-SSLeay|Net_SSLeay"
      perl-Crypt-SSLeay-0.57-2
      perl-Net_SSLeay.pm-1.55-3
    
  • Set PERL and PERL5LIB variables in /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg
    • Perl 5.8.8 from older archive
      Use this PERL
      PERL=/opt/freeware/bin/perl
      
      Make sure that /usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi and /opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi are included in PERL5LIB path like below (same possition, in front of /usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi)
      PERL5LIB=/home/stor2rrd/stor2rrd/bin:/opt/freeware/lib/perl5/vendor_perl/5.8.8/ppc-thread-multi:/usr/opt/perl5/lib/site_perl/5.8.8/aix-thread-multi:/usr/opt/perl5/lib/site_perl/5.8.8:/usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi:/opt/freeware/lib/perl/5.8.8:/home/stor2rrd/stor2rrd/lib
      
    • Perl 5.20+ (using yum installation):
      PERL=/usr/bin/perl
      PERL5LIB=/home/stor2rrd/stor2rrd/bin:/home/stor2rrd/stor2rrd/lib:/opt/freeware/lib/perl5/5.30/vendor_perl:/opt/freeware/lib64/perl5/5.30/vendor_perl
      
  • Verify it, it must show 6.x version.
    # su - stor2rrd (lpar2rrd if you are on the appliance)
    . /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg
    $PERL -MLWP -e 'use LWP::Protocol::https; print "LWP Version: $LWP::VERSION\n"'
      LWP Version: 6.06
    
  • Assure there it does not print any http/https module missing
    cd /home/stor2rrd/stor2rrd
    . etc/stor2rrd.cfg
    $PERL bin/perl_modules_check.pl
    

Linux

  • Install
    # yum install perl-LWP-Protocol-https perl-Mozilla-CA perl-Crypt-SSLeay 
    
  • Check on RHEL7 and older:
    # rpm -qa | egrep "perl-LWP-Protocol-https|perl-Mozilla-CA|perl-Crypt-SSLeay"
      perl-Mozilla-CA-20130114-5.el7.noarch
      perl-LWP-Protocol-https-6.04-4.el7.noarch
      perl-Crypt-SSLeay-0.64-5.el7.x86_64
    
    RHEL8:
    # rpm -qa | egrep "perl-LWP-Protocol-https|perl-Mozilla-CA|perl-Net-SSLeay"
      perl-Mozilla-CA-20160104-7.module_el8.3.0+416+dee7bcef.noarch
      perl-Net-SSLeay-1.85-6.el8.x86_64
      perl-LWP-Protocol-https-6.07-4.module_el8.3.0+416+dee7bcef.noarch
    
  • RHEL6/CentOS6:
    The perl-LWP-Protocol-https package is only provided in RHEL 7, but the same name module /usr/share/perl5/vendor_perl/LWP/Protocol/https.pm is provided by perl-libwww-perl package which is available in RHEL 6
    # yum install perl-libwww-perl
    
  • Verify it, it must show 6.x version.
    # su - stor2rrd (lpar2rrd if you are on the appliance)
    . /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg
    $PERL -MLWP -e 'use LWP::Protocol::https; print "LWP Version: $LWP::VERSION\n"'
      LWP Version: 6.06
    
  • Assure there it does not print any http/https module missing
    cd /home/stor2rrd/stor2rrd
    . etc/stor2rrd.cfg
    $PERL bin/perl_modules_check.pl
    

Linux Debian (Ubuntu, Mint), Docker

  • Install
    Note that liblwp-protocol-https-perl must be exactly at version 6.04-2!
    Other available versions like actually default stable 6.06-2, or 6.02-1 and 6.07-2 have a bug which might prevent working it with the latest storage firmwares.
    Only Debian based Linux distributions are affected.
    # apt-get install liblwp-protocol-https-perl=6.04-2 libcrypt-ssleay-perl libio-socket-ssl-perl libmozilla-ldap-perl
    
    If you do not have access to the internet then get it from liblwp-protocol-https-perl 6.04-2

  • Check:
    # dpkg --list liblwp-protocol-https-perl libcrypt-ssleay-perl libio-socket-ssl-perl libmozilla-ldap-perl
      ||/ Name                       Version        Architecture Description
      +++-==========================-==============-======-================================================================
      ii  liblwp-protocol-https-perl 6.04-2         all    HTTPS driver for LWP::UserAgent
      ii  libcrypt-ssleay-perl       0.58-1build1   amd64  OpenSSL support for LWP
      ii  libio-socket-ssl-perl      1.965-1ubuntu1 all    Perl module implementing object oriented interface to SSL sockets
      ii  libmozilla-ldap-perl       1.5.3-1build1  amd64  LDAP Perl module for the OpenLDAP C SDK
    
  • Prevent updating it in operating system
    # apt-mark hold liblwp-protocol-https-perl
      liblwp-protocol-https-perl set on hold.
    
  • Verify it, it must show 6.04-2 version.
    # su - stor2rrd (lpar2rrd if you are on the appliance)
    . /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg
    $PERL -MLWP -e 'use LWP::Protocol::https; print "LWP Version: $LWP::VERSION\n"'
      LWP Version: 6.04-2
    
  • Assure there it does not print any http/https module missing
    cd /home/stor2rrd/stor2rrd
    . etc/stor2rrd.cfg
    $PERL bin/perl_modules_check.pl
    

Activate SSL support on Solaris

Install these perl modules:
umask 022
cpan Crypt::SSLeay
cpan Net::HTTPS
cpan Net::SSL
cpan IO::Socket::SSL
It was tested with Perl 5.24.0, use this in etc/lpar2rrd.cfg
PERL=/usr/local/bin/perl
PERL5LIB=/export/home/lpar2rrd/lpar2rrd/bin:/usr/local/lib/perl5/site_perl/5.24.0:/usr/local/lib/perl/5.24.0:/export/home/lpar2rrd/lpar2rrd/lib:/usr/local/lib/perl5/site_perl/5.24.0/sun4-solaris:/usr/local/lib/perl5/site_perl/5.24.0/sun4-solaris/auto:/usr/perl5/vendor_perl/5.12/sun4-solaris-64int

SuSE Linux