From d24ce878e00dd18abf71d6851ac852863f1077af Mon Sep 17 00:00:00 2001 From: sakolish Date: Tue, 15 Jan 2008 15:29:42 +0000 Subject: [PATCH] Make Net::SSL required for FSP plugin - Line #37 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@270 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/fsp.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xCAT-server-2.0/lib/xcat/plugins/fsp.pm b/xCAT-server-2.0/lib/xcat/plugins/fsp.pm index 87ae99975..54c352b8d 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/fsp.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/fsp.pm @@ -21,6 +21,26 @@ sub handled_commands { # Process request from xCat daemon ########################################################################## sub process_request { + + ####################################################### + # IO::Socket::SSL apparently does not work with LWP.pm + # When used, POST/GETs return immediately with: + # 500 Can't connect to :443 (Timeout) + # + # Net::HTTPS, used by LWP::Protocol::https::Socket, + # uses either IO::Socket::SSL or Net::SSL. It chooses + # by looking to see if $IO::Socket::SSL::VERSION + # is defined (i.e. the module's already loaded) and + # uses that if so. If not, it first tries Net::SSL, + # then IO::Socket::SSL only if that cannot be loaded. + ####################################################### + eval { require Net::SSL }; + if ( $@ ) { + my $callback = $_[1]; + $callback->( {data=>[$@]} ); + return(1); + } + $IO::Socket::SSL::VERSION = undef; xCAT::PPC::process_request(__PACKAGE__,@_); }