const VERSION_TLS12
pub const VERSION_TLS12 = 771Purpose
Constant VERSION_TLS12, defining protocol or algorithm parameters.
#crypto/tlsTLS 1.2/1.3 client subset implemented in Xu, with system-root verification by default. ECDH, RSA, AES and GHASH are variable-time on current backends.
const VERSION_TLS12pub const VERSION_TLS12 = 771Constant VERSION_TLS12, defining protocol or algorithm parameters.
const VERSION_TLS13pub const VERSION_TLS13 = 772Constant VERSION_TLS13, defining protocol or algorithm parameters.
const TLS_AES_128_GCM_SHA256pub const TLS_AES_128_GCM_SHA256 = 4865Constant TLS_AES_128_GCM_SHA256, defining protocol or algorithm parameters.
const TLS_RSA_WITH_AES_128_GCM_SHA256pub const TLS_RSA_WITH_AES_128_GCM_SHA256 = 156Constant TLS_RSA_WITH_AES_128_GCM_SHA256, defining protocol or algorithm parameters.
const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256pub const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 49195Constant TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, defining protocol or algorithm parameters.
const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256pub const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 49199Constant TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, defining protocol or algorithm parameters.
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
}Tls Configuration parameters and options set.
server_name stringinsecure_skip_verify boolroot_cas x509.CertPoolcert_pem stringkey_pem stringstruct Dialerpub struct Dialer {
pub timeout_ns int
pub config Config
}Structure encapsulating timeout_ns, config.
timeout_ns intconfig Configstruct Connpub struct Conn {
pub server_name string
pub handshake_complete bool
pub cipher_suite int
pub version int
pub negotiated_protocol string
pub read_deadline_ns int
pub write_deadline_ns int
}Structure encapsulating server_name, handshake_complete, cipher_suite, version, negotiated_protocol.
server_name stringhandshake_complete boolcipher_suite intversion intnegotiated_protocol stringread_deadline_ns intwrite_deadline_ns intstruct ConnectionStatepub struct ConnectionState {
pub server_name string
pub handshake_complete bool
pub cipher_suite int
pub version int
pub negotiated_protocol string
}Structure encapsulating server_name, handshake_complete, cipher_suite, version, negotiated_protocol.
server_name stringhandshake_complete boolcipher_suite intversion intnegotiated_protocol stringnew_configpub fn new_config(server_name string) ConfigConstruct config.
server_name stringConfig — a value of this type
($&Config) set_next_protospub fn (c $&Config) set_next_protos(protocols []string)Set the ordered ALPN protocols offered by this client. Empty omits ALPN each nonempty name must contain at most 255 bytes, checked at handshake.
c $&ConfigConfig instance used by this call (exclusive borrow).protocols []stringThis call does not return a value.
new_dialerpub fn new_dialer() DialerConstruct dialer.
No arguments are required.
Dialer — a value of this type
closed_connpub fn closed_conn() ConnInert transport placeholder for owners that do not currently use TLS. It owns no descriptor and cannot perform a handshake without a transport.
No arguments are required.
Conn — a value of this type
clientpub fn client(c net.Conn, config &Config) ConnExecute client. Throws on failure; handle the error or propagate it to the caller.
c net.Connconfig &ConfigConn — a value of this type
client_pipepub fn client_pipe(c net.PipeConn, config &Config) ConnClient pipe. Throws on failure; handle the error or propagate it to the caller.
c net.PipeConnconfig &ConfigConn — a value of this type
serverpub fn server(c net.Conn, config &Config) ConnExecute server. Throws on failure; handle the error or propagate it to the caller.
c net.Connconfig &ConfigConn — a value of this type
server_pipepub fn server_pipe(c net.PipeConn, config &Config) ConnServer pipe. Throws on failure; handle the error or propagate it to the caller.
c net.PipeConnconfig &ConfigConn — a value of this type
client_fdpub fn client_fd(fd int, server_name string) ConnClient fd. Throws on failure; handle the error or propagate it to the caller.
fd intserver_name stringConn — a value of this type
dialpub fn dial(network string, addr string, config &Config) ConnDial a connection. Throws on failure; handle the error or propagate it to the caller.
network stringaddr stringconfig &ConfigConn — a value of this type
dial_contextpub fn dial_context(ctx &context.Context, network string, addr string, config &Config) ConnDial context. Throws on failure; handle the error or propagate it to the caller.
ctx &context.Contextnetwork stringaddr stringconfig &ConfigConn — a value of this type
(Dialer) dialpub fn (d Dialer) dial(network string, addr string) ConnOperation on Dialer: dial a connection. Throws on failure; handle the error or propagate it to the caller.
d DialerDialer instance used by this call (value receiver).network stringaddr stringConn — a value of this type
(Dialer) dial_contextpub fn (d Dialer) dial_context(ctx &context.Context, network string, addr string) ConnOperation on Dialer: dial context. Throws on failure; handle the error or propagate it to the caller.
d DialerDialer instance used by this call (value receiver).ctx &context.Contextnetwork stringaddr stringConn — a value of this type
(&Conn) handshakepub fn (c &Conn) handshake() intExecute handshake on &Conn. Throws on failure; handle the error or propagate it to the caller.
c &ConnConn instance used by this call (borrow).int — a value of this type
(Conn) connection_statepub fn (c Conn) connection_state() ConnectionStateOperation on Conn: connection state.
c ConnConn instance used by this call (value receiver).ConnectionState — a value of this type
($&Conn) set_deadlinepub fn (c $&Conn) set_deadline(t_ns int) intOperation on $&Conn: set deadline. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).t_ns intint — a value of this type
($&Conn) set_read_deadlinepub fn (c $&Conn) set_read_deadline(t_ns int) intOperation on $&Conn: set read deadline. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).t_ns intint — a value of this type
($&Conn) set_write_deadlinepub fn (c $&Conn) set_write_deadline(t_ns int) intOperation on $&Conn: set write deadline. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).t_ns intint — a value of this type
($&Conn) readpub fn (c $&Conn) read(max int) stringOperation on $&Conn: read up to max bytes. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).max intstring — result string
($&Conn) writepub fn (c $&Conn) write(data &string) intOperation on $&Conn: write data and return the byte count. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).data &stringint — bytes written
($&Conn) closepub fn (c $&Conn) close() intOperation on $&Conn: close the resource. Throws on failure; handle the error or propagate it to the caller.
c $&ConnConn instance used by this call (exclusive borrow).int — a value of this type
($&Conn) read_resultpub fn (c $&Conn) read_result(n int) io.ReadResultOperation on $&Conn: read result.
c $&ConnConn instance used by this call (exclusive borrow).n intio.ReadResult — a value of this type
($&Conn) write_resultpub fn (c $&Conn) write_result(data string) io.WriteResultOperation on $&Conn: write result.
c $&ConnConn instance used by this call (exclusive borrow).data stringio.WriteResult — a value of this type