}
String files = " - " + Props.KEY_NIMBUS_CERT + ": " + certPath + '\n';
files += " - " + Props.KEY_NIMBUS_KEY + ": " + keyPath + '\n';
print.debugln(files);
final GlobusCredential credential = NimbusCredential.getGlobusCredential();
if (credential != null) {
print.debugln("Using Nimbus credential from properties:");
print.debugln(" - " + NimbusCredential.getNimbusCertificatePath());
print.debugln(" - " + NimbusCredential.getNimbusUnencryptedKeyPath());
print.debugln();
return credential;
}
String err = "Could not load credential from properties, properties are " +
"probably not set.\n";
print.debugln(err);
err += files;
if(!error_ok) {
throw new Exception(err);
}
accumulatedErrors.append(err);
} catch (Exception e) {
final String err = "Problem loading credential from properties:\n " +
CommonUtil.recurseForSomeString(e);
accumulatedErrors.append(err).append('\n');
print.debugln(err);
if(!error_ok) {
throw e;
}
}
try {
print.debugln("Attempting to load the default X509 proxy file");
final GlobusCredential credential = GlobusCredential.getDefaultCredential();
print.debugln("Using default X509 proxy:");
proxyInformation(credential, print);
return credential;
} catch (Exception e) {
final String err = "Problem loading default proxy credential:" +
"\n " + CommonUtil.recurseForSomeString(e);
accumulatedErrors.append(err).append('\n');
print.debugln(err);
}
final String dotNimbus = expandTilde("~/.nimbus/");
try {
print.debugln("\nLooking for unencrypted credential in ~/.nimbus");
final File usercert = guessCertFromDirectory(dotNimbus);
final File userkey = guessKeyFromDirectory(dotNimbus);
final GlobusCredential credential =
getUnencryptedUsercert(usercert, userkey, print);
NimbusCredential.setUnencryptedCredential(usercert.getAbsolutePath(),
userkey.getAbsolutePath());
print.debugln("Using unencrypted ~/.nimbus credential\n");
return credential;
} catch (Exception e) {
final String err = "Problem loading from ~/.nimbus:\n " +
CommonUtil.recurseForSomeString(e);
accumulatedErrors.append(err).append('\n');
print.debugln(err);
}
final String dotGlobus = expandTilde("~/.globus/");
try {
print.debugln("\nLooking for unencrypted credential in ~/.globus");
final File usercert = guessCertFromDirectory(dotGlobus);
final File userkey = guessKeyFromDirectory(dotGlobus);
final GlobusCredential credential =
getUnencryptedUsercert(usercert, userkey, print);
NimbusCredential.setUnencryptedCredential(usercert.getAbsolutePath(),
userkey.getAbsolutePath());
print.debugln("Using unencrypted ~/.globus credential\n");
return credential;