Skip to content

Commit

Permalink
Item14205: Fix some issues with FCGI, undefined, and Certs
Browse files Browse the repository at this point in the history
Only the path or file can be passed for the CA Certificate store. Some
verions will reject the connection if both methods are provided.  So if
both exist, us the bundle file if it's available.

The STDERR capture doesn't work on FCGI,  so bypass capturing on that
platform.

Correct some undefined errors.
  • Loading branch information
gac410 committed Nov 8, 2016
1 parent a5aef45 commit a7b968a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
21 changes: 15 additions & 6 deletions core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
Expand Up @@ -254,7 +254,13 @@ NOCERT
my $err;

if ( $Foswiki::cfg{SMTP}{MAILHOST} ) {
( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );

if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/FastCGI$/ ) {
( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
}
else {
$ok = _autoconfigSMTP($reporter);
}
unless ($ok) {
$reporter->WARN(
"SMTP configuration using $Foswiki::cfg{SMTP}{MAILHOST} failed. Falling back to mail program"
Expand All @@ -267,14 +273,17 @@ NOCERT
);
}

$reporter->NOTE($out);
$reporter->NOTE($out) if defined $out;

if ($err) {
if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/CLI$/ ) {

# Double-space the debug output so that it doesn't wrap.
$err =~ s/\n/\n\n/sg;
$err =~ s/\n$//g;
# Double-space the debug output so that it doesn't wrap.
$err =~ s#\n#<br/>#sg;
$err =~ s/\n$//g;
}

$reporter->NOTE( <<OUT );
$reporter->NOTE( <<OUT ) if ($err);
======= DEBUG MESSAGES ====
$err
OUT
Expand Down
4 changes: 3 additions & 1 deletion core/lib/Foswiki/Configure/Wizards/SSLCertificates.pm
Expand Up @@ -85,6 +85,8 @@ sub guess_locations {
}
}

return undef if ($guessed);

# First see if the linux default path work
foreach $path (@CERT_DIRS) {
if ( -d $path && -r $path ) {
Expand All @@ -111,7 +113,7 @@ sub _setLocations {
$Foswiki::cfg{Email}{SSLCaFile} = $_[1];
$_[0]->CHANGED('{Email}{SSLCaFile}');
}
if ( $_[2] ) {
elsif ( $_[2] ) {
$Foswiki::cfg{Email}{SSLCaPath} = $_[2];
$_[0]->CHANGED('{Email}{SSLCaPath}');
}
Expand Down
2 changes: 1 addition & 1 deletion core/tools/configure
Expand Up @@ -64,7 +64,7 @@ require Foswiki::Configure::Query;

sub NOTE {
my $this = shift;
my $text = join( "\n", @_ ) . "\n";
my $text = join( "\n", @_ ) . "\n" if ( scalar @_ );
$this->{notes}++;

# Take out block formatting tags
Expand Down

0 comments on commit a7b968a

Please sign in to comment.