Explorar el Código

Fix ConfigInitialNode certificate SAN generation (#75622)

CertGenUtils#createCommonName already returns a GeneralName of
type other, we should not by wrapping it in another GeneralName
of type other. Generated certificates are mangled and implementations
assume that there are no SANs present.
Ioannis Kakavas hace 4 años
padre
commit
73c4e54dc5

+ 1 - 1
x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/ConfigInitialNode.java

@@ -434,7 +434,7 @@ public class ConfigInitialNode extends EnvironmentAwareCommand {
             }
         }
         // this is the unequivocal, non-standard, mark for a cert generated by this auto-config process
-        generalNameSet.add(new GeneralName(GeneralName.otherName, CertGenUtils.createCommonName(ConfigInitialNode.class.getName())));
+        generalNameSet.add(CertGenUtils.createCommonName(ConfigInitialNode.class.getName()));
         return new GeneralNames(generalNameSet.toArray(new GeneralName[0]));
     }