提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
创建主机名验证器
/******************************************************************************* * Copyright (c) 2012,2014 EclipseSource and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Holger Staudacher - initial API and implementation ******************************************************************************/ /* 来自 *时代Java*/ //package com.nowjava; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLSession; public class Main { public static void main(String[] argv) throws Exception { System.out.println(createHostNameVerifier()); } public static HostnameVerifier createHostNameVerifier() {/* 来自 N o w J a v a . c o m*/ HostnameVerifier verifier = new HostnameVerifier() { @Override