ddclient/svn/patches/ubuntu/checked_ssl_load.diff
wimpunk 2863dd459d Added debian and ubuntu patches
git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@69 3873ddee-7413-0410-b6c4-c2c57c1ab35a
2007-07-30 07:11:22 +00:00

34 lines
1.2 KiB
Diff

--- ddclient-3.7.1/ddclient.orig 2007-05-03 23:24:39.000000000 +0100
+++ ddclient-3.7.1/ddclient 2007-05-03 23:27:44.000000000 +0100
@@ -1635,6 +1642,20 @@
$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 +1684,7 @@
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;