# the server-dependent client configuration consists of:
my $ca_dn; # The CA's Distinguished Name
my $server_dn; # The server's Distinguished Name
-my $server_host;# The server's hostname or IP address
+my $server_host;# The server's hostname or IP address, '*' means to be determined from server output
my $server_port;# The server's port
my $server_tls; # The server's TLS port, if any, or 0
my $server_path;# The server's CMP alias
print "$server_name server PID=$pid\n";
if ($server_host eq '*' || $server_port == 0) {
- # Find out the actual server host and port and possibly different PID
+ my $server_output = "";
+ # Determine the actual server host and port and possibly different PID from server output
my ($host, $port);
my $pid0 = $pid;
while (<$server_fh>) {
+ $server_output .= $_;
print "$server_name server output: $_";
next if m/[Uu]sing section/;
s/\R$//; # Better chomp
kill('KILL', $pid0);
waitpid($pid0, 0);
}
- }
- if ($server_host eq '*' || $server_port == 0) {
- stop_server($server_name, $pid) if $pid;
- print "Cannot get expected output from the $server_name server\n";
- return 0;
+ if ($server_host eq '*' || $server_port == 0) {
+ stop_server($server_name, $pid) if $pid;
+ print "Cannot get server host and port from the $server_name server output: $server_output\n";
+ return 0;
+ }
}
$kur_port = $server_port if $kur_port eq "\$server_port";
$pbm_port = $server_port if $pbm_port eq "\$server_port";
[Mock] # the built-in OpenSSL CMP mock server
# no_check_time = 1
server_host = * # to be determined by server: 127.0.0.1 or ::1 (localhost)
-server_port = 0 # 0 means that the port is determined by the server
+server_port = 0 # 0 means that the port is determined from server output
server_tls = $server_port
server_cert = server.crt
# server = $server_host:$server_port