本文整理汇总了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);
}
示例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();
}
}