jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java
equal
deleted
inserted
replaced
163 * code in HostnameChecker. |
163 * code in HostnameChecker. |
164 */ |
164 */ |
165 private static String getServername(X509Certificate peerCert) { |
165 private static String getServername(X509Certificate peerCert) { |
166 try { |
166 try { |
167 // compare to subjectAltNames if dnsName is present |
167 // compare to subjectAltNames if dnsName is present |
168 Collection subjAltNames = peerCert.getSubjectAlternativeNames(); |
168 Collection<List<?>> subjAltNames = peerCert.getSubjectAlternativeNames(); |
169 if (subjAltNames != null) { |
169 if (subjAltNames != null) { |
170 for (Iterator itr = subjAltNames.iterator(); itr.hasNext(); ) { |
170 for (Iterator<List<?>> itr = subjAltNames.iterator(); itr.hasNext(); ) { |
171 List next = (List)itr.next(); |
171 List<?> next = itr.next(); |
172 if (((Integer)next.get(0)).intValue() == 2) { |
172 if (((Integer)next.get(0)).intValue() == 2) { |
173 // compare dNSName with host in url |
173 // compare dNSName with host in url |
174 String dnsName = ((String)next.get(1)); |
174 String dnsName = ((String)next.get(1)); |
175 return dnsName; |
175 return dnsName; |
176 } |
176 } |