fapifta commented on code in PR #4427:
URL: https://github.com/apache/ozone/pull/4427#discussion_r1145574963
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java:
##########
@@ -503,6 +505,56 @@ public void storeCertificate(String pemEncodedCert,
certificateCodec, true);
}
+ /**
+ * Stores all Certificates in this response on local disk.
+ * @param response - response from SCM
+ * @return first certificate ID
+ * @throws CertificateException - on Error
+ */
+ public String storeCertificate(SCMGetCertResponseProto response)
+ throws CertificateException {
+ return storeCertificate(response,
+ getSecurityConfig().getCertificateLocation(getComponentName()));
+ }
+
+ protected String storeCertificate(SCMGetCertResponseProto response,
+ Path codecPath) throws CertificateException {
+ CertificateCodec certCodec = new CertificateCodec(securityConfig,
+ codecPath);
+ try {
+ String pemEncodedCert = response.getX509Certificate();
Review Comment:
In the response this one is a required field, so afaik the server side fails
to create the response without this field set, and we get an error before we
get here.
See:
https://github.com/apache/ozone/blob/master/hadoop-hdds/interface-server/src/main/proto/ScmServerSecurityProtocol.proto#L174-L185
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]