equal
deleted
inserted
replaced
213 |
213 |
214 private static void handshake(String name, SSLSocket sock) throws IOException { |
214 private static void handshake(String name, SSLSocket sock) throws IOException { |
215 if (name == null) { |
215 if (name == null) { |
216 // no name set. No need to check |
216 // no name set. No need to check |
217 return; |
217 return; |
218 } else if (name.equals("127.0.0.1")) { |
218 } else if (name.equals("localhost")) { |
219 name = "localhost"; |
219 name = "localhost"; |
220 } |
220 } |
221 final String fname = name; |
221 final String fname = name; |
222 final InetAddress addr1 = InetAddress.getByName(name); |
222 final InetAddress addr1 = InetAddress.getByName(name); |
223 SSLParameters params = sock.getSSLParameters(); |
223 SSLParameters params = sock.getSSLParameters(); |
224 SNIMatcher matcher = new SNIMatcher(StandardConstants.SNI_HOST_NAME) { |
224 SNIMatcher matcher = new SNIMatcher(StandardConstants.SNI_HOST_NAME) { |
225 public boolean matches (SNIServerName n) { |
225 public boolean matches (SNIServerName n) { |
226 String host = ((SNIHostName)n).getAsciiName(); |
226 String host = ((SNIHostName)n).getAsciiName(); |
227 if (host.equals("127.0.0.1")) |
227 if (host.equals("localhost")) |
228 host = "localhost"; |
228 host = "localhost"; |
229 boolean cmp = host.equalsIgnoreCase(fname); |
229 boolean cmp = host.equalsIgnoreCase(fname); |
230 if (cmp) |
230 if (cmp) |
231 return true; |
231 return true; |
232 return compareIPAddrs(addr1, host); |
232 return compareIPAddrs(addr1, host); |