当前位置: 首页>>代码示例>>Java>>正文


Java HttpsURLConnectionImpl类代码示例

本文整理汇总了Java中sun.net.www.protocol.https.HttpsURLConnectionImpl的典型用法代码示例。如果您正苦于以下问题:Java HttpsURLConnectionImpl类的具体用法?Java HttpsURLConnectionImpl怎么用?Java HttpsURLConnectionImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HttpsURLConnectionImpl类属于sun.net.www.protocol.https包,在下文中一共展示了HttpsURLConnectionImpl类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AssertWebSSOApplicationStep

import sun.net.www.protocol.https.HttpsURLConnectionImpl; //导入依赖的package包/类
public AssertWebSSOApplicationStep(String webssoClient1URL,
		String webssoClient2URL,int webssoHttpsPort,int jasigHttpsPort,int acegiHttpsPort) {
	this.webssoClient1URL = webssoClient1URL;
	this.webssoClient2URL = webssoClient2URL;
	this.jasigHttpsPort=jasigHttpsPort;
	this.acegiHttpsPort=acegiHttpsPort;
	this.webssoHttpsPort=webssoHttpsPort;
	
	log.info("WebSSOClient1URL  " + webssoClient1URL + "WebSSOClient2URL  "
			+ webssoClient2URL); 
	HostnameVerifier hostnameVerifier = new HostnameVerifier() {
		public boolean verify(String hostname, SSLSession session) {
			return true;
		}
	};
	HttpsURLConnectionImpl.setDefaultHostnameVerifier(hostnameVerifier);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:18,代码来源:AssertWebSSOApplicationStep.java

示例2: allowPatchCommand

import sun.net.www.protocol.https.HttpsURLConnectionImpl; //导入依赖的package包/类
private static void allowPatchCommand(java.net.HttpURLConnection conn) {
	Object target = null;
	try {
		if (conn instanceof HttpsURLConnectionImpl) {
			final Field delegate = HttpsURLConnectionImpl.class
					.getDeclaredField("delegate");
			delegate.setAccessible(true);
			target = delegate.get(conn);
		} else {
			target = conn;
		}

		final Field f = HttpURLConnection.class.getDeclaredField("methods");
		f.setAccessible(true);
		int last = 6; // index 6 is TRACE
		// TODO: temp solution to replace trace with patch
		((String[]) f.get(target))[last] = "PATCH";
	} catch (NoSuchFieldException | IllegalAccessException e) {
		// TODO: log
		e.printStackTrace();
	}
}
 
开发者ID:Kloudless,项目名称:kloudless-java,代码行数:23,代码来源:APIResource.java


注:本文中的sun.net.www.protocol.https.HttpsURLConnectionImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。