26 |
26 |
|
27 |
27 |
package edu.ucsb.nceas.metacat.admin;
|
28 |
28 |
|
|
29 |
import java.io.File;
|
29 |
30 |
import java.util.Vector;
|
30 |
31 |
|
31 |
32 |
import javax.servlet.http.HttpServletRequest;
|
... | ... | |
56 |
57 |
import edu.ucsb.nceas.utilities.FileUtil;
|
57 |
58 |
import edu.ucsb.nceas.utilities.GeneralPropertyException;
|
58 |
59 |
import edu.ucsb.nceas.utilities.PropertiesMetaData;
|
|
60 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
|
59 |
61 |
import edu.ucsb.nceas.utilities.SortedProperties;
|
60 |
62 |
import edu.ucsb.nceas.utilities.UtilException;
|
61 |
63 |
|
... | ... | |
354 |
356 |
private void registerDataONEMemberNode() {
|
355 |
357 |
CNode cn;
|
356 |
358 |
try {
|
|
359 |
logMetacat.debug("Get the Node description.");
|
|
360 |
Node node = MNodeService.getInstance().getCapabilities();
|
357 |
361 |
logMetacat.debug("Setting client certificate location.");
|
358 |
|
String mnCertificatePath = "/etc/dataone/client/certs/DEMO01.pem";
|
|
362 |
String certificatePath = PropertyService.getProperty("dataone.certpath");
|
|
363 |
if (!certificatePath.endsWith(File.separator)) {
|
|
364 |
certificatePath = certificatePath + File.separator;
|
|
365 |
}
|
|
366 |
String mnCertificatePath = certificatePath + node.getIdentifier().getValue() + ".pem";
|
359 |
367 |
CertificateManager.getInstance().setCertificateLocation(mnCertificatePath);
|
360 |
368 |
cn = D1Client.getCN();
|
361 |
|
logMetacat.debug("Get the Node description.");
|
362 |
|
Node node = MNodeService.getInstance().getCapabilities();
|
363 |
369 |
logMetacat.debug("Registering node with DataONE.");
|
364 |
370 |
// Session is null, because the libclient code automatically sets up an
|
365 |
371 |
// SSL session for us using the client certificate provided
|
... | ... | |
375 |
381 |
logMetacat.warn("Could not register as node with DataONE (" + e.getCode() + "/" + e.getDetail_code() + "): " + e.getDescription());
|
376 |
382 |
} catch (IdentifierNotUnique e) {
|
377 |
383 |
logMetacat.warn("Could not register as node with DataONE (" + e.getCode() + "/" + e.getDetail_code() + "): " + e.getDescription());
|
|
384 |
} catch (PropertyNotFoundException e) {
|
|
385 |
logMetacat.warn("Could not find the location for client certificates: " + e.getMessage());
|
378 |
386 |
}
|
379 |
387 |
}
|
380 |
388 |
}
|
Pull the certificate path for dataone certificates from the metacat properties file.