Module net.openssl stdlib

net.openssl
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
4
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

#constant is_used

is_used = 1

Sum types

This section is empty.

Functions

#fn new_ssl_conn

fn new_ssl_conn(config SSLConnectConfig) !&SSLConn

new_ssl_conn instance an new SSLCon struct

Structs

#struct C.SSL

typedef
pub struct C.SSL {
}

#struct C.SSL_CTX

typedef
pub struct C.SSL_CTX {
}

#struct SSLConn

pub struct SSLConn {
	config SSLConnectConfig
mut:
	sslctx   &C.SSL_CTX = unsafe { nil }
	ssl      &C.SSL     = unsafe { nil }
	handle   int
	duration time.Duration

	owns_socket bool
}

SSLConn is the current connection

#fn (&SSLConn) shutdown

fn (mut s &SSLConn) shutdown() !

shutdown closes the ssl connection and does cleanup

#fn (&SSLConn) init

fn (mut s &SSLConn) init() !

#fn (&SSLConn) connect

fn (mut s &SSLConn) connect(mut tcp_conn &net.TcpConn, hostname string) !

connect to server using OpenSSL

#fn (&SSLConn) dial

fn (mut s &SSLConn) dial(hostname string, port int) !

dial opens an ssl connection on hostname:port

#fn (&SSLConn) complete_connect

fn (mut s &SSLConn) complete_connect() !

#fn (&SSLConn) socket_read_into_ptr

fn (mut s &SSLConn) socket_read_into_ptr(buf_ptr &u8, len int) !int

#fn (&SSLConn) read

fn (mut s &SSLConn) read(mut buffer &[]u8) !int

#fn (&SSLConn) write_ptr

fn (mut s &SSLConn) write_ptr(bytes &u8, len int) !int

write_ptr writes len bytes from bytes to the ssl connection

#fn (&SSLConn) write

fn (mut s &SSLConn) write(bytes []u8) !int

write writes data from bytes to the ssl connection

#fn (&SSLConn) write_string

fn (mut s &SSLConn) write_string(str string) !int

write_string writes a string to the ssl connection

#struct SSLConnectConfig

params
pub struct SSLConnectConfig {
	verify   string // the path to a rootca.pem file, containing trusted CA certificate(s)
	cert     string // the path to a cert.pem file, containing client certificate(s) for the request
	cert_key string // the path to a key.pem file, containing private keys for the client certificate(s)
	validate bool   // set this to true, if you want to stop requests, when their certificates are found to be invalid

	in_memory_verification bool // if true, verify, cert, and cert_key are read from memory, not from a file
}

Interfaces

This section is empty.

Enums

This section is empty.