Commit 9feec903 authored by Leigh Stoller's avatar Leigh Stoller

Allow passing just the cert/key file when creating the context object

so that we do not have to load a certificate from file just so the
context creator can get the filename out of it.
parent e5e6aa74
#!/usr/bin/perl -w
#
# Copyright (c) 2008-2015 University of Utah and the Flux Group.
# Copyright (c) 2008-2016 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
......@@ -80,12 +80,20 @@ my $PACKAGE_VERSION = 0.1;
sub Context($$;$$)
{
my ($class, $certificate, $keyfile, $password) = @_;
my $certfile;
$keyfile = $certificate->certfile()
if (!defined($keyfile));
if (ref($certificate)) {
$certfile = $certificate->certfile();
}
else {
$certfile = $certificate;
$certificate = undef;
}
my $self = {"certificate" => $certificate,
"certfile" => $certificate->certfile(),
"certfile" => $certfile,
"keyfile" => $keyfile,
"password" => $password};
bless($self, $class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment