本文整理了Java中okhttp3.Handshake.<init>()
方法的一些代码示例,展示了Handshake.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Handshake.<init>()
方法的具体详情如下:
包路径:okhttp3.Handshake
类名称:Handshake
方法名:<init>
暂无
代码示例来源:origin: square/okhttp
public static Handshake get(TlsVersion tlsVersion, CipherSuite cipherSuite,
List<Certificate> peerCertificates, List<Certificate> localCertificates) {
if (tlsVersion == null) throw new NullPointerException("tlsVersion == null");
if (cipherSuite == null) throw new NullPointerException("cipherSuite == null");
return new Handshake(tlsVersion, cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: square/okhttp
public static Handshake get(SSLSession session) throws IOException {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuiteString)) {
throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL");
}
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
String tlsVersionString = session.getProtocol();
if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null");
if ("NONE".equals(tlsVersionString)) throw new IOException("tlsVersion == NONE");
TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.emptyList();
return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: com.squareup.okhttp3/okhttp
public static Handshake get(TlsVersion tlsVersion, CipherSuite cipherSuite,
List<Certificate> peerCertificates, List<Certificate> localCertificates) {
if (tlsVersion == null) throw new NullPointerException("tlsVersion == null");
if (cipherSuite == null) throw new NullPointerException("cipherSuite == null");
return new Handshake(tlsVersion, cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: com.squareup.okhttp3/okhttp
public static Handshake get(SSLSession session) throws IOException {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuiteString)) {
throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL");
}
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
String tlsVersionString = session.getProtocol();
if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null");
if ("NONE".equals(tlsVersionString)) throw new IOException("tlsVersion == NONE");
TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.emptyList();
return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: com.github.ljun20160606/okhttp
public static Handshake get(TlsVersion tlsVersion, CipherSuite cipherSuite,
List<Certificate> peerCertificates, List<Certificate> localCertificates) {
if (tlsVersion == null) throw new NullPointerException("tlsVersion == null");
if (cipherSuite == null) throw new NullPointerException("cipherSuite == null");
return new Handshake(tlsVersion, cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: huxq17/SwipeCardsView
public static Handshake get(CipherSuite cipherSuite, List<Certificate> peerCertificates,
List<Certificate> localCertificates) {
if (cipherSuite == null) throw new IllegalArgumentException("cipherSuite == null");
return new Handshake(cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: apache/servicemix-bundles
public static Handshake get(TlsVersion tlsVersion, CipherSuite cipherSuite,
List<Certificate> peerCertificates, List<Certificate> localCertificates) {
if (tlsVersion == null) throw new NullPointerException("tlsVersion == null");
if (cipherSuite == null) throw new NullPointerException("cipherSuite == null");
return new Handshake(tlsVersion, cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: duzechao/OKHttpUtils
public static Handshake get(TlsVersion tlsVersion, CipherSuite cipherSuite,
List<Certificate> peerCertificates, List<Certificate> localCertificates) {
if (cipherSuite == null) throw new IllegalArgumentException("cipherSuite == null");
return new Handshake(tlsVersion, cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: huxq17/tractor
public static Handshake get(CipherSuite cipherSuite, List<Certificate> peerCertificates,
List<Certificate> localCertificates) {
if (cipherSuite == null) throw new IllegalArgumentException("cipherSuite == null");
return new Handshake(cipherSuite, Util.immutableList(peerCertificates),
Util.immutableList(localCertificates));
}
代码示例来源:origin: huxq17/tractor
public static Handshake get(SSLSession session) {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.<Certificate>emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.<Certificate>emptyList();
return new Handshake(cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: huxq17/SwipeCardsView
public static Handshake get(SSLSession session) {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.<Certificate>emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.<Certificate>emptyList();
return new Handshake(cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: apache/servicemix-bundles
public static Handshake get(SSLSession session) throws IOException {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
if ("SSL_NULL_WITH_NULL_NULL".equals(cipherSuiteString)) {
throw new IOException("cipherSuite == SSL_NULL_WITH_NULL_NULL");
}
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
String tlsVersionString = session.getProtocol();
if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null");
if ("NONE".equals(tlsVersionString)) throw new IOException("tlsVersion == NONE");
TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.<Certificate>emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.<Certificate>emptyList();
return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: duzechao/OKHttpUtils
public static Handshake get(SSLSession session) {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
String tlsVersionString = session.getProtocol();
if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null");
TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.<Certificate>emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.<Certificate>emptyList();
return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList);
}
代码示例来源:origin: com.github.ljun20160606/okhttp
public static Handshake get(SSLSession session) {
String cipherSuiteString = session.getCipherSuite();
if (cipherSuiteString == null) throw new IllegalStateException("cipherSuite == null");
CipherSuite cipherSuite = CipherSuite.forJavaName(cipherSuiteString);
String tlsVersionString = session.getProtocol();
if (tlsVersionString == null) throw new IllegalStateException("tlsVersion == null");
TlsVersion tlsVersion = TlsVersion.forJavaName(tlsVersionString);
Certificate[] peerCertificates;
try {
peerCertificates = session.getPeerCertificates();
} catch (SSLPeerUnverifiedException ignored) {
peerCertificates = null;
}
List<Certificate> peerCertificatesList = peerCertificates != null
? Util.immutableList(peerCertificates)
: Collections.<Certificate>emptyList();
Certificate[] localCertificates = session.getLocalCertificates();
List<Certificate> localCertificatesList = localCertificates != null
? Util.immutableList(localCertificates)
: Collections.<Certificate>emptyList();
return new Handshake(tlsVersion, cipherSuite, peerCertificatesList, localCertificatesList);
}
内容来源于网络,如有侵权,请联系作者删除!