Commit 21c684c9 authored by Leigh Stoller's avatar Leigh Stoller

Add reregistration of SES certificate.

Delete cached ClearingHouse credential.
parent bdee352d
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# Copyright (c) 2008-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -31,7 +31,7 @@ my $PGENIDOMAIN = "@PROTOGENI_DOMAIN@";
my $PGENISUPPORT = @PROTOGENI_SUPPORT@;
my $SACERT = "$TB/etc/genisa.pem";
my $CMCERT = "$TB/etc/genicm.pem";
my $CHCERT = "$TB/etc/genich.pem";
my $SESCERT = "$TB/etc/genises.pem";
# un-taint path
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin:/usr/site/bin';
......@@ -76,16 +76,21 @@ if (!defined($context)) {
}
#
# Note that we had to send the clearinghouse $TB/etc/emulab.pem so they
# know about this new site. That is sent out of band (email).
# Flush existing ClearingHouse credential.
#
print "Getting credential to talk to clearinghouse ...\n";
my $credential = GeniRegistry::ClearingHouse->GetCredential($context);
if (!defined($credential)) {
fatal("Could not get credential to talk to clearinghouse");
print STDERR "Could not create clearinghouse credential\n";
return undef;
}
my $clearinghouse = GeniRegistry::ClearingHouse->Create($context,
$credential);
$credential->Delete();
#
# Note that we had to send the clearinghouse $TB/etc/emulab.pem so they
# know about this new site. That is sent out of band (email).
#
print "Getting credential to talk to clearinghouse ...\n";
my $clearinghouse = GeniRegistry::ClearingHouse->Create($context);
if (!defined($clearinghouse)) {
fatal("Could not create a clearinghouse client");
}
......@@ -105,7 +110,16 @@ print "Registering CM cert at the clearinghouse.\n";
if ($clearinghouse->Register("CM", $cmcert->cert())) {
fatal("Could not register CM cert at the clearinghouse");
}
if (-e $SESCERT) {
my $sescert = GeniCertificate->LoadFromFile($SESCERT);
if (!defined($sescert)) {
fatal("Could not load certificate from $SESCERT\n");
}
print "Registering SES cert at the clearinghouse.\n";
if ($clearinghouse->Register("SES", $sescert->cert())) {
fatal("Could not register SES cert at the clearinghouse");
}
}
exit(0);
sub fatal($)
......
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