1. Diab Jerius
  2. wikiup

Commits

dje...@cfa.harvard.edu  committed 7dc0d4d

allow bypass of host certificate on SSL connections

  • Participants
  • Parent commits e71a8f0
  • Branches default

Comments (0)

Files changed (1)

File src/wikiup.pl.in

View file
   $config->set( transform => $ARGV{transform} )
     if defined $ARGV{transform} && ! defined $config->get( 'transform' );
 
+  $config->set( insecure => $ARGV{insecure} );
+
   # set attributes
   $config->set_attr( $_ ) foreach split( ',', $ARGV{attrs} );
 
 	     attrs => '',
 	     rename => 0,
 	     verbose => 0,
+	     insecure => 0,
 	     interactive => 0,
 	    );
 
 			  config|f=s
 			  dryrun|n
 			  help
+			  insecure
 			  interactive|i
 			  keepgoing|k
 			  man
 	my %lcnf;
 	@lcnf{@lattr} = map { delete $cnf{$_} } @lattr;
 
+	if ( $lcnf{config}->get('insecure') ) {
+
+	    $cnf{ssl_opts} = { verify_hostname => 0 };
+	    eval { require IO::Socket::SSL;
+
+		   $cnf{ssl_opts}{SSL_verify_mode}
+		       = IO::Socket::SSL::SSL_VERIFY_NONE();
+	       };
+	}
+
 	my $self = $class->SUPER::new ( %cnf );
 
 	# very very ugly. store my object data in the hash.  could one
 
 Use an alternative configuration file.
 
+=item --insecure
+
+Do I<not> verify host certificates when connecting to hosts using SSL.
+This should only be necessary when connecting to hosts with self-signed
+certificates.
+
 =item -k
 
 Ignore upload errors and plow on ahead.