yandrey321 commented on code in PR #12114:
URL: https://github.com/apache/ozone/pull/12114#discussion_r4676506656


##########
hadoop-ozone/cli-repair/src/main/java/org/apache/hadoop/ozone/repair/scm/cert/RecoverSCMCertificate.java:
##########
@@ -149,12 +148,32 @@ private static X509Certificate getRootCertificate(
     return cert.get();
   }
 
-  private static X509Certificate getSubCertificate(
-      Map<BigInteger, X509Certificate> allCerts, String hostName) throws 
Exception {
+  /** This SCM's ID, or null if its storage cannot be read: then certificates 
are only matched by host name. */
+  private String getScmId() {
+    try {
+      return new SCMStorageConfig(getOzoneConf()).getScmId();
+    } catch (IOException e) {
+      error("Failed to read the SCM ID, matching certificates by host name 
only: %s", e.getMessage());
+      return null;
+    }
+  }
+
+  /** Whether this SCM issued {@code rootCertificate}: its subject has this 
host name or, if longer, this SCM ID. */
+  @VisibleForTesting

Review Comment:
   fixed



-- 
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]

Reply via email to