跳转至

StreamPeerSSL

继承

StreamPeer

简要描述

SSL流对等体。

描述

SSL流对等体。

成员

类型 属性名 默认值
bool blocking_handshake true

方法

返回值类型 方法名称
int accept_stream(stream: StreamPeer, private_key: CryptoKey, certificate: X509Certificate, chain: X509Certificate = null)
int connect_to_stream(stream: StreamPeer, validate_certs: bool = false, for_hostname: String = "", valid_certificate: X509Certificate = null)
void disconnect_from_stream()
int get_status() const
void poll()
##枚举
enum Status:
- STATUS_DISCONNECTED = 0

表示StreamPeerSSL断开连接的状态。

  • STATUS_HANDSHAKING = 1

  • STATUS_CONNECTED = 2

表示StreamPeerSSL连接到主机的状态。

  • STATUS_ERROR = 3

  • STATUS_ERROR_HOSTNAME_MISMATCH = 4

错误状态,显示主机提供的SSL证书域与请求验证的域不匹配。


常量

成员说明

  • bool blocking_handshake
Default true
setter set_blocking_handshake_enabled(value)
getter is_blocking_handshake_enabled

方法说明

  • accept_stream accept_stream(stream: StreamPeer, private_key: CryptoKey, certificate: X509Certificate, chain: X509Certificate = null)

使用给定的private_key接受对等连接作为服务器,并向客户端提供给定的certificate


  • connect_to_stream connect_to_stream(stream: StreamPeer, validate_certs: bool = false, for_hostname: String = "", valid_certificate: X509Certificate = null)

使用基础的StreamPeer stream连接到对等方。

**注意:**由于浏览器的限制,HTML5导出不支持指定自定义valid_certificate


  • disconnect_from_stream disconnect_from_stream()

与主机断开连接。


  • get_status get_status() const

返回连接状态。


  • poll poll()

轮询连接以检查传入的字节。