java.lang.Object
org.miaixz.bus.http.socket.Handshake
TLS 握手记录
记录 HTTPS 连接的 TLS 握手信息,包括 TLS 版本、密码套件、远程和本地证书。 用于描述已完成的握手,可通过 ConnectionSuite 配置新的握手策略。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescription获取密码套件boolean比较两个 Handshake 对象是否相等static Handshakeget(SSLSession session) 从 SSL 会话创建 Handshake 实例static Handshakeget(org.miaixz.bus.core.net.tls.TlsVersion tlsVersion, CipherSuite cipherSuite, List<Certificate> peerCertificates, List<Certificate> localCertificates) 创建 Handshake 实例inthashCode()计算 Handshake 对象的哈希码获取本地证书列表获取本地主体获取远程对等点证书列表获取远程对等点主体org.miaixz.bus.core.net.tls.TlsVersion获取 TLS 版本toString()返回 Handshake 的字符串表示
-
Method Details
-
get
从 SSL 会话创建 Handshake 实例- Parameters:
session- SSL 会话- Returns:
- Handshake 实例
- Throws:
IOException- 如果会话无效或解析失败
-
get
public static Handshake get(org.miaixz.bus.core.net.tls.TlsVersion tlsVersion, CipherSuite cipherSuite, List<Certificate> peerCertificates, List<Certificate> localCertificates) 创建 Handshake 实例- Parameters:
tlsVersion- TLS 版本cipherSuite- 密码套件peerCertificates- 远程对等点证书列表localCertificates- 本地证书列表- Returns:
- Handshake 实例
- Throws:
NullPointerException- 如果 tlsVersion 或 cipherSuite 为 null
-
tlsVersion
public org.miaixz.bus.core.net.tls.TlsVersion tlsVersion()获取 TLS 版本- Returns:
- TLS 版本
-
cipherSuite
获取密码套件- Returns:
- 密码套件
-
peerCertificates
获取远程对等点证书列表- Returns:
- 不可修改的证书列表(可能为空)
-
peerPrincipal
获取远程对等点主体- Returns:
- 主体(匿名时为 null)
-
localCertificates
获取本地证书列表- Returns:
- 不可修改的证书列表(可能为空)
-
localPrincipal
获取本地主体- Returns:
- 主体(匿名时为 null)
-
equals
比较两个 Handshake 对象是否相等 -
hashCode
public int hashCode()计算 Handshake 对象的哈希码 -
toString
返回 Handshake 的字符串表示
-