[ 
https://issues.apache.org/jira/browse/HDDS-1119?focusedWorklogId=213596&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-213596
 ]

ASF GitHub Bot logged work on HDDS-1119:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Mar/19 05:43
            Start Date: 15/Mar/19 05:43
    Worklog Time Spent: 10m 
      Work Description: ajayydv commented on pull request #601: HDDS-1119. DN 
get OM certificate from SCM CA for block token validat…
URL: https://github.com/apache/hadoop/pull/601#discussion_r265855638
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java
 ##########
 @@ -349,29 +441,39 @@ public X509Certificate queryCertificate(String query) {
   }
 
   /**
-   * Stores the Certificate  for this client. Don't use this api to add
-   * trusted certificates of other components.
+   * Stores the Certificate  for this client. Don't use this api to add trusted
+   * certificates of others.
    *
-   * @param certificate - X509 Certificate
+   * @param pemEncodedCert - pem encoded X509 Certificate
+   * @param force - override any existing file
    * @throws CertificateException - on Error.
+   *
    */
   @Override
-  public void storeCertificate(X509Certificate certificate)
+  public void storeCertificate(String pemEncodedCert, boolean force)
       throws CertificateException {
     CertificateCodec certificateCodec = new CertificateCodec(securityConfig);
     try {
-      certificateCodec.writeCertificate(
-          new X509CertificateHolder(certificate.getEncoded()));
-    } catch (IOException | CertificateEncodingException e) {
+      Path basePath = securityConfig.getCertificateLocation();
+      String certName;
+      X509Certificate cert =
+          CertificateCodec.getX509Certificate(pemEncodedCert);
+      certName = String.format(CERT_FILE_NAME_FORMAT,
 
 Review comment:
   done.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 213596)
    Time Spent: 8h 40m  (was: 8.5h)

> DN get OM certificate from SCM CA for block token validation
> ------------------------------------------------------------
>
>                 Key: HDDS-1119
>                 URL: https://issues.apache.org/jira/browse/HDDS-1119
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Xiaoyu Yao
>            Assignee: Ajay Kumar
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 8h 40m
>  Remaining Estimate: 0h
>
> This is needed when the DN received blockĀ token signed by OM and it does not 
> have the certificate that OM.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to