Skip to content

Commit

Permalink
secureserver.pl: make OpenSSL CApath and cert absolute path values
Browse files Browse the repository at this point in the history
Recent stunnel versions (5.08) seem to have trouble with relative
paths on Windows. This turns the relative paths into absolute ones.
  • Loading branch information
mback2k committed Dec 19, 2014
1 parent a390329 commit 3b7bf29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/secureserver.pl
Expand Up @@ -33,6 +33,7 @@ BEGIN
use strict;
use warnings;
use Cwd;
use Cwd 'abs_path';

use serverhelp qw(
server_pidfilename
Expand Down Expand Up @@ -62,6 +63,7 @@ BEGIN
my $idnum = 1; # dafault stunneled server instance number
my $proto = 'https'; # default secure server protocol
my $conffile; # stunnel configuration file
my $capath; # certificate chain PEM folder
my $certfile; # certificate chain PEM file

#***************************************************************************
Expand Down Expand Up @@ -178,7 +180,9 @@ sub exit_signal_handler {

$conffile = "$path/stunnel.conf";

$capath = abs_path($path);
$certfile = "$srcdir/". ($stuncert?"certs/$stuncert":"stunnel.pem");
$certfile = abs_path($certfile);

my $ssltext = uc($proto) ." SSL/TLS:";

Expand Down Expand Up @@ -254,7 +258,7 @@ sub exit_signal_handler {
# stunnel configuration file
if(open(STUNCONF, ">$conffile")) {
print STUNCONF "
CApath = $path
CApath = $capath
cert = $certfile
debug = $loglevel
socket = $socketopt";
Expand Down Expand Up @@ -285,7 +289,7 @@ sub exit_signal_handler {
if($verbose) {
print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n";
print "cmd: $cmd\n";
print "CApath = $path\n";
print "CApath = $capath\n";
print "cert = $certfile\n";
print "pid = $pidfile\n";
print "debug = $loglevel\n";
Expand Down

0 comments on commit 3b7bf29

Please sign in to comment.