When I try to use the Perl SDK v5.5 I get SOAP request errors (using Net::HTTP 6.06):
./script.pl --vmname <blah> --server <my server>
SOAP request error - possibly a protocol issue: <?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
I did some research and it seemed that Net::HTTP 6.06 doesn't work so I downgraded to Net::HTTP 6.03, but still no luck - different errors:
# perl -MNet::HTTP -le 'print $Net::HTTP::VERSION'
6.03
./script.pl --vmname <blah> --server <my server>
SOAP request error - possibly a protocol issue: Undefined subroutine &LWP::Protocol::https::Socket::can_read called at /usr/local/share/perl5/LWP/Protocol/http.pm line 22
Any ideas of how to make this work with the downgraded Net::HTTP?
Thanks in advance for your help.
I think I have this solved - need to downgrade more than just Net::HTTP to get this to work:
in cpan: install GAAS/libwww-perl-6.03.tar.gz
No more error.
I am going to leave this un-resolved for a day in case I run into more errors.
Thanks you a lot msennot, this fixed the problem for me. I was trying to run a nagios plugin to monitor my vSphere 5.5 environment (Check VMware API - check_vmware_api.pl)
I am just curious but how did you find out about libwww-perl?
Simply installing libwww-perl version 5.837 resolved my issue. The other versions don't work for me.
cpan[3]> i /libwww-perl/
Distribution GAAS/libwww-perl-5.837.tar.gz
Distribution GAAS/libwww-perl-6.01.tar.gz
Distribution GAAS/libwww-perl-6.05.tar.gz
Author LWWWP ("The libwww-perl mailing list" <libwww@perl.org>)
4 items found
cpan[4]> install GAAS/libwww-perl-5.837.tar.gz
Running make for G/GA/GAAS/libwww-perl-5.837.tar.gz
Checksum for /root/.cpan/sources/authors/id/G/GA/GAAS/libwww-perl-5.837.tar.gz ok
CPAN.pm: Going to build G/GA/GAAS/libwww-perl-5.837.tar.gz
Thank You MR-Z. Those steps resolve the issue for me.
Yes! you helped me out a lot, removing the SSL module solved it.
All the downgrading didn't work on CentOS 7.
For future ref:
Linux hidden 3.10.0-123.9.3.el7.x86_64 #1 SMP Thu Nov 6 15:06:03 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@hidden vmware-vsphere-cli-distrib]# cat /etc/*eleas*
CentOS Linux release 7.0.1406 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CentOS Linux release 7.0.1406 (Core)
CentOS Linux release 7.0.1406 (Core)
cpe:/o:centos:centos:7
Thanks MR-Z, SDK 5.5 scripts works in CentOS 7 after installing the "GAAS/libwww-perl-5.837.tar.gz"
The patch worked also on VMware-vSphere-CLI-6.0.0. Thank you william-faulk. Made some changes due to small differences on file source. Patch should be unzipped and applied before install, inside untarred directory vmware-vsphere-cli-distrib:
# cd vmware-sphere-cli-distrib
# patch -p0 < VMware-vSphere-CLI-6.0.0-slowbecauseofSSL.patch
I found it necessary to use two sets of ssl_opts for the three instances of LWP::UserAgent. This was the only way I could handle my need to use IP Address rather than hostnames:
# diff VICommon.pm VICommon.pm.ori
426a427,435
> if ($1 eq "s") {
> eval {
> require Crypt::SSLeay;
> Crypt::SSLeay->import();
> };
> if ($@) {
> die "Crypt::SSLeay is required for https connections, but could not be loaded: $@";
> }
> }
442,444d450
<
< $user_agent->ssl_opts('verify_hostname' => 0);
< $user_agent->ssl_opts('SSL_verify_mode' => 0);
497a504,505
> #To remove SSL Warning, switching from IO::Socket::SSL to Net::SSL
> $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
502a511,520
> # bug 288336
> if ($1 eq "s") {
> eval {
> require Crypt::SSLeay;
> Crypt::SSLeay->import();
> };
> if ($@) {
> die "Crypt::SSLeay is required for https connections, but could not be loaded: $@";
> }
> }
514,516d531
<
< $user_agent->ssl_opts('verify_hostname' => 0);
< $user_agent->ssl_opts('SSL_verify_mode' => 0);
2099,2101d2113
< $user_agent->ssl_opts('verify_hostname' => 0);
< $user_agent->ssl_opts('SSL_verify_mode' => 0);
<
2134,2135c2146,2147
< return (defined $user_agent->cookie_jar and
< $user_agent->cookie_jar->as_string ne '');
---
> return defined $user_agent->cookie_jar and
> $user_agent->cookie_jar->as_string ne '';
As per my understanding on reported problem this issue is related to RHEL 7. However, referring to vSphere SDK for Perl 5.5 Release Notes
SDK for Perl 5.5 is supported on the following Linux platforms:
So RHEL 7 is not supported by SDK for Perl 5.5
Please let me know in case my understanding is incorrect.
Thank you so much for this solution! "Installing libwww-perl version 5.837" worked for me and helped resolve the SOAP error.