--- loncom/configuration/SSL.pm 2017/05/18 22:13:57 1.5 +++ loncom/configuration/SSL.pm 2018/12/22 17:06:06 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Checksum installed LON-CAPA modules and some configuration files # -# $Id: SSL.pm,v 1.5 2017/05/18 22:13:57 raeburn Exp $ +# $Id: SSL.pm,v 1.8 2018/12/22 17:06:06 raeburn Exp $ # # The LearningOnline Network with CAPA # @@ -31,7 +31,7 @@ package LONCAPA::SSL; use strict; use lib '/home/httpd/lib/perl/'; -use Apache::lonlocal(); +use Apache::lonlocal; use Apache::lonnet(); use Apache::loncommon(); use Apache::lonhtmlcommon(); @@ -48,7 +48,7 @@ sub print_certstatus { 'avai' => 'Available', 'yes' => 'Yes', 'no' => 'No', - 'cn' => 'Common Name', + 'cn' => 'Common Name (CN)', 'start' => 'Valid From', 'end' => 'Valid To', 'alg' => 'Signature Algorithm', @@ -62,15 +62,20 @@ sub print_certstatus { 'expired' => 'Expired', 'future' => 'Future validity', 'nokey' => 'No key', - 'otherkey' => 'No matching key', + 'otherkey' => 'No matching key', + 'revoked' => 'Revoked by CA', + 'wrongcn' => 'Incorrect CN', + 'mismatch' => 'Mismatched Issuer', ); my @files = qw(key host hostname ca); my @fields = qw(status cn start end alg size email); foreach my $server (sort(keys(%{$servers}))) { - my ($result,$hashref) = &Apache::lonnet::get_servercerts_info($server,$context); + my $hostname = $servers->{$server}; + my ($result,$hashref) = &Apache::lonnet::get_servercerts_info($server, + $hostname, + $context); if ($result eq 'ok' && ref($hashref) eq 'HASH') { if ($target eq 'web') { - my $hostname = &Apache::lonnet::hostname($server); $message .= "
'; } else { + if (keys(%csr)) { + foreach my $file (keys(%csr)) { + if (ref($hashref->{$file.'-csr'}) eq 'HASH') { + $message .= $file.'-csr=yes,'; + foreach my $item (@fields) { + $message .= $hashref->{$file.'-csr'}->{$item}.','; + } + $message =~ s/,$//; + $message .= '&'; + } + } + } $message =~ s/\&$//; } $message .= "\n";