v / vlib / veb / ssl_d_use_openssl.v
34 lines · 30 sloc · 964 bytes · 39ee5fb9e80298cdd41330658b492736f52a98b4
Raw
1module veb
2
3import net
4import time
5
6@[params]
7pub struct SSLConnectConfig {
8pub:
9 verify string
10 cert string
11 cert_key string
12 validate bool
13 in_memory_verification bool
14 read_timeout time.Duration
15}
16
17@[params]
18pub struct RunParams {
19pub:
20 // use `family: .ip, host: 'localhost'` when you want it to bind only to 127.0.0.1
21 family net.AddrFamily = .ip6
22 host string
23 port int = default_port
24 nr_workers int = 1
25 show_startup_message bool = true
26 timeout_in_seconds int = 30
27 max_request_buffer_size int = 8192
28 benchmark_page_generation bool // for the "page rendered in X ms"
29 ssl_config SSLConnectConfig
30}
31
32fn run_at_with_ssl[A, X](mut _global_app A, _params RunParams) ! {
33 return error('veb HTTPS server requires net.mbedtls; -d use_openssl only avoids mbedtls for HTTP apps')
34}
35