mirror of
https://github.com/vlang/v.git
synced 2025-08-03 17:57:59 -04:00
23 lines
498 B
V
23 lines
498 B
V
module ssl
|
|
|
|
import net
|
|
|
|
// SSLDialer is a concrete instance of the Dialer interface,
|
|
// for creating SSL socket connections.
|
|
pub struct SSLDialer {
|
|
config SSLConnectConfig
|
|
}
|
|
|
|
// create_ssl_dialer creates a dialer that will initiate SSL secured
|
|
// connections.
|
|
pub fn new_ssl_dialer(config SSLConnectConfig) net.Dialer {
|
|
return &SSLDialer{
|
|
config: config
|
|
}
|
|
}
|
|
|
|
// dial initiates a new SSL connection.
|
|
pub fn (d SSLDialer) dial(address string) !net.Connection {
|
|
return new_ssl_conn(d.config)!
|
|
}
|