version 1.1, 2004/06/29 10:47:46
|
version 1.3, 2004/06/29 11:32:06
|
Line 54 use LONCAPA::Configuration;
|
Line 54 use LONCAPA::Configuration;
|
|
|
# Global variable declarations: |
# Global variable declarations: |
|
|
$SSLCommand; # Full path to openssl command. |
my $SSLCommand; # Full path to openssl command. |
$CertificateDirectory; # LONCAPA Certificate directory. |
my $CertificateDirectory; # LONCAPA Certificate directory. |
$KeyFilename; # Key filename (within CertificateDirectory). |
my $KeyFilename; # Key filename (within CertificateDirectory). |
$Passphrase="loncapawhatever"; # Initial passphrase for keyfile |
my $Passphrase="loncapawhatever"; # Initial passphrase for keyfile |
$RequestEmail; # Email address of loncapa cert admin. |
my $RequestEmail; # Email address of loncapa cert admin. |
|
|
|
|
|
|
# Debug/log support: |
# Debug/log support: |
# |
# |
|
my $DEBUG = 1; # 1 for on, 0 for off. |
$DEBUG = 1; # 1 for on, 0 for off. |
|
|
|
# Send debugging to stderr. |
# Send debugging to stderr. |
# Parameters: |
# Parameters: |
Line 72 $DEBUG = 1; # 1 for on, 0 for off.
|
Line 73 $DEBUG = 1; # 1 for on, 0 for off.
|
# $DEBUG - message is only written if this is true. |
# $DEBUG - message is only written if this is true. |
# |
# |
sub Debug { |
sub Debug { |
$msg = shift; |
my $msg = shift; |
if($DEBUG) { |
if($DEBUG) { |
print STDERR "$msg\n"; |
print STDERR "$msg\n"; |
} |
} |
} |
} |
|
|
|
# |
|
# Read the LonCAPA web config files to get the values of the |
|
# configuration global variables we need: |
|
# Implicit inputs: |
|
# loncapa.conf - configuration file to read (user specific). |
|
# Implicit outputs (see global variables section): |
|
# SSLCommand, |
|
# CertificateDirectory |
|
# KeyfileName |
|
# RequestEmail |
|
# Side-Effects: |
|
# Exit with error if cannot complete. |
|
# |
|
sub ReadConfig { |
|
|
|
Debug("Reading configuration"); |
|
my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf'); |
|
|
|
# Name of the SSL Program |
|
|
|
if($perlvarref->{SSLProgram}) { |
|
$SSLCommand = $perlvarref->{SSLProgram}; |
|
Debug("SSL Command: $SSLCommand"); |
|
} |
|
else { |
|
die "Unable to read the SSLCommand configuration option\n"; |
|
} |
|
|
|
# Where the certificates, and host key are installed: |
|
|
|
if($perlvarref->{lonCertificateDirectory}) { |
|
$CertificateDirectory = $perlvarref->{lonCertificateDirectory}; |
|
Debug("Local certificate Directory: $CertificateDirectory"); |
|
} |
|
else { |
|
die "Unable to read SSLDirectory configuration option\n"; |
|
} |
|
# The name of the host key file (to be installed in SSLDirectory). |
|
# |
|
if($perlvarref->{lonnetPrivateKey}) { |
|
$KeyFilename = $perlvarref->{lonnetPrivateKey}; |
|
Debug("Private key will be installed as $KeyFilename"); |
|
} |
|
else { |
|
die "Unable to read lonnetPrivateKey conrig paraemter\n"; |
|
} |
|
# The email address to which the certificate request is sent: |
|
|
sub ReadConfig {} |
if($perlvarref->{SSLEmail}) { |
|
$RequestEmail = $perlvarref->{SSLEmail}; |
|
Debug("Certificate request will be sent to $RequestEmail"); |
|
} |
|
else { |
|
die "Could not read SSLEmail coniguration key"; |
|
} |
|
} |
sub GenerateRequest {} |
sub GenerateRequest {} |
sub InstallKey {} |
sub InstallKey {} |
sub MailRequest {} |
sub MailRequest {} |