anmolnar commented on a change in pull request #1353:
URL: https://github.com/apache/zookeeper/pull/1353#discussion_r427121077
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/common/ZKHostnameVerifier.java
##########
@@ -324,8 +324,14 @@ private static HostNameType determineHostFormat(final
String host) {
for (List<?> entry : entries) {
final Integer type = entry.size() >= 2 ? (Integer)
entry.get(0) : null;
if (type != null) {
- final String s = (String) entry.get(1);
- result.add(new SubjectName(s, type));
+ if (type == SubjectName.DNS || type == SubjectName.IP) {
+ final Object o = entry.get(1);
+ if (o instanceof String) {
+ result.add(new SubjectName((String) o, type));
+ } else if (o instanceof byte[]) {
+ // TODO ASN.1 DER encoded form
Review comment:
I believe it can be done with BouncyCastle ASN1 libraries, but this part
was missing in the original patch too. I'd be happy to add it as a separate
ticket, but first I need an example certificate with ASN1 encoded data.
----------------------------------------------------------------
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]