const version_tls12
pub const version_tls12 = 771用途
公开常量 `version_tls12`。 值为 `771`
参数
无
API
#crypto/tlsTLS 客户端子集。握手走宿主平台库(macOS SecureTransport;Linux/Windows 目前 throw)。
const version_tls12pub const version_tls12 = 771公开常量 `version_tls12`。 值为 `771`
无
const version_tls13pub const version_tls13 = 772公开常量 `version_tls13`。 值为 `772`
无
const tls_aes_128_gcm_sha256pub const tls_aes_128_gcm_sha256 = 4865公开常量 `tls_aes_128_gcm_sha256`。 值为 `4865`
无
const tls_rsa_with_aes_128_gcm_sha256pub const tls_rsa_with_aes_128_gcm_sha256 = 156公开常量 `tls_rsa_with_aes_128_gcm_sha256`。 值为 `156`
无
const tls_ecdhe_rsa_with_aes_128_gcm_sha256pub const tls_ecdhe_rsa_with_aes_128_gcm_sha256 = 49199公开常量 `tls_ecdhe_rsa_with_aes_128_gcm_sha256`。 值为 `49199`
无
struct Configpub struct Config {
pub server_name string
pub insecure_skip_verify bool
pub root_cas x509.CertPool
pub cert_pem string
pub key_pem string
}公开结构体 `Config`。
server_name stringinsecure_skip_verify boolroot_cas x509.CertPoolcert_pem stringkey_pem stringstruct Dialerpub struct Dialer {
pub timeout_ns int
pub config Config
}公开结构体 `Dialer`。
timeout_ns intconfig Configstruct Connpub struct Conn {
pub server_name string
pub handshake_complete bool
pub cipher_suite int
pub version int
pub read_deadline_ns int
pub write_deadline_ns int
}公开结构体 `Conn`。
server_name stringhandshake_complete boolcipher_suite intversion intread_deadline_ns intwrite_deadline_ns intstruct ConnectionStatepub struct ConnectionState {
pub server_name string
pub handshake_complete bool
pub cipher_suite int
pub version int
}公开结构体 `ConnectionState`。
server_name stringhandshake_complete boolcipher_suite intversion intnew_configpub fn new_config(server_name string) Config构造 config。
server_name stringConfig — 该类型的值
new_dialerpub fn new_dialer() Dialer构造 dialer。
无
Dialer — 该类型的值
closed_connpub fn closed_conn() Connclosed连接。
无
Conn — 该类型的值
clientpub fn client(c net.Conn, config &Config) Conn客户端。失败时 throw。
c net.Connconfig &ConfigConn — 该类型的值
client_pipepub fn client_pipe(c net.PipeConn, config &Config) Conn客户端pipe。失败时 throw。
c net.PipeConnconfig &ConfigConn — 该类型的值
serverpub fn server(c net.Conn, config &Config) Conn服务端。失败时 throw。
c net.Connconfig &ConfigConn — 该类型的值
server_pipepub fn server_pipe(c net.PipeConn, config &Config) Conn服务端pipe。失败时 throw。
c net.PipeConnconfig &ConfigConn — 该类型的值
client_fdpub fn client_fd(fd int, server_name string) Conn客户端fd。失败时 throw。
fd intserver_name stringConn — 该类型的值
dialpub fn dial(network string, addr string, config &Config) Conn发起连接。失败时 throw。
network stringaddr stringconfig &ConfigConn — 该类型的值
dial_contextpub fn dial_context(ctx &context.Context, network string, addr string, config &Config) Conn带上下文拨号。失败时 throw。
ctx &context.Contextnetwork stringaddr stringconfig &ConfigConn — 该类型的值
(Dialer) dialpub fn (d Dialer) dial(network string, addr string) Conn`Dialer` 上的方法:发起连接。失败时 throw。
d Dialernetwork stringaddr stringConn — 该类型的值
(Dialer) dial_contextpub fn (d Dialer) dial_context(ctx &context.Context, network string, addr string) Conn`Dialer` 上的方法:带上下文拨号。失败时 throw。
d Dialerctx &context.Contextnetwork stringaddr stringConn — 该类型的值
(&Conn) handshakepub fn (c &Conn) handshake() int在 `&Conn` 上调用 `handshake`。失败时 throw。
c &Connint — 该类型的值
(Conn) connection_statepub fn (c Conn) connection_state() ConnectionState`Conn` 上的方法:connectionstate。
c ConnConnectionState — 该类型的值
(&mut Conn) set_deadlinepub fn (c &mut Conn) set_deadline(t_ns int) int`&mut Conn` 上的方法:设置 deadline。
c &mut Connt_ns intint — 该类型的值
(&mut Conn) set_read_deadlinepub fn (c &mut Conn) set_read_deadline(t_ns int) int`&mut Conn` 上的方法:设置 read deadline。
c &mut Connt_ns intint — 该类型的值
(&mut Conn) set_write_deadlinepub fn (c &mut Conn) set_write_deadline(t_ns int) int`&mut Conn` 上的方法:设置 write deadline。
c &mut Connt_ns intint — 该类型的值
(&mut Conn) readpub fn (c &mut Conn) read(max int) string`&mut Conn` 上的方法:读出最多 max 字节。失败时 throw。
c &mut Connmax intstring — 结果字符串
(&mut Conn) writepub fn (c &mut Conn) write(data &string) int`&mut Conn` 上的方法:写入数据,返回写入的字节数。失败时 throw。
c &mut Conndata &stringint — 写入的字节数
(&mut Conn) closepub fn (c &mut Conn) close() int`&mut Conn` 上的方法:关闭资源。失败时 throw。
c &mut Connint — 该类型的值
(&mut Conn) read_resultpub fn (c &mut Conn) read_result(n int) io.ReadResult`&mut Conn` 上的方法:读取结果。
c &mut Connn intio.ReadResult — 该类型的值
(&mut Conn) write_resultpub fn (c &mut Conn) write_result(data string) io.WriteResult`&mut Conn` 上的方法:写入结果。
c &mut Conndata stringio.WriteResult — 该类型的值