From 85bb9aaee2a23e923a375ca8f77ae4ed6f98a3a9 Mon Sep 17 00:00:00 2001 From: wimpunk Date: Sat, 19 May 2007 11:22:59 +0000 Subject: [PATCH] Applied checked_ssl_load.diff from ubuntu git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk/svn@47 3873ddee-7413-0410-b6c4-c2c57c1ab35a --- ddclient | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ddclient b/ddclient index 044ea1f..7017017 100755 --- a/ddclient +++ b/ddclient @@ -1635,6 +1635,20 @@ sub encode_base64 ($;$) { $res; } ###################################################################### +## load_ssl_support +###################################################################### +sub load_ssl_support { + my $ssl_loaded = eval {require IO::Socket::SSL}; + unless ($ssl_loaded) { + fatal(<<"EOM"); +Error loading the Perl module IO::Socket::SSL needed for SSL connect. +On Debian, the package libio-socket-ssl-perl must be installed. +EOM + } + import IO::Socket::SSL; + { no warnings; $IO::Socket::SSL::DEBUG = 0; } +} +###################################################################### ## geturl ###################################################################### sub geturl { @@ -1663,9 +1677,7 @@ sub geturl { if ( $globals{'ssl'} and (caller(1))[3] ne 'main::get_ip' ) { $use_ssl = 1; $default_port = 443; - require IO::Socket::SSL; - import IO::Socket::SSL; - { no warnings; $IO::Socket::SSL::DEBUG = 0; } + load_ssl_support; } else { $use_ssl = 0; $default_port = 80;