fapifta commented on code in PR #11803:
URL: https://github.com/apache/ozone/pull/11803#discussion_r4616266485


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/DNCertificateClient.java:
##########
@@ -88,6 +88,16 @@ public CertificateSignRequest.Builder configureCSRBuilder()
     }
   }
 
+  /**
+   * Returns the host name that goes into the subject of this client's CSR.
+   * Resolving it is as slow as the host's resolver, so tests override this.
+   *
+   * @return the canonical host name of the host this client runs on
+   */
+  protected String getLocalHostName() throws IOException {

Review Comment:
   ```suggestion
     @VisibleForTesting
     protected String getLocalHostName() throws IOException {
   ```



##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java:
##########
@@ -563,11 +566,26 @@ private boolean verifySignature(byte[] data, byte[] 
signature,
   public CertificateSignRequest.Builder configureCSRBuilder() throws 
SCMSecurityException {
     return new CertificateSignRequest.Builder()
         .setConfiguration(securityConfig)
-        .addInetAddresses()
+        .addInetAddresses(getLocalInetAddresses())
         .setDigitalEncryption(true)
         .setDigitalSignature(true);
   }
 
+  /**
+   * Returns the local addresses that go into the SAN extension of this 
client's CSR.
+   * Resolving them is as slow as the host's resolver, so tests override this.
+   *
+   * @return the addresses of the host this client runs on
+   */
+  protected List<InetAddress> getLocalInetAddresses() throws 
SCMSecurityException {

Review Comment:
   ```suggestion
     @VisibleForTesting
     protected List<InetAddress> getLocalInetAddresses() throws 
SCMSecurityException {
   ```



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