1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: support plain http protocol

This commit is contained in:
Delyan Angelov
2019-08-21 20:04:06 +03:00
committed by Alexander Medvednikov
parent e35ef3b83e
commit 51818346df
8 changed files with 103 additions and 35 deletions

View File

@@ -38,7 +38,7 @@ fn init_module() {
//C.OPENSSL_config(0)
}
fn ssl_do(method, host_name, path string) Response {
fn ssl_do(port int, method, host_name, path string) Response {
//ssl_method := C.SSLv23_method()
ssl_method := C.TLSv1_2_method()
if isnil(method) {
@@ -55,7 +55,7 @@ fn ssl_do(method, host_name, path string) Response {
web := C.BIO_new_ssl_connect(ctx)
if isnil(ctx) {
}
addr := host_name + ':443'
addr := host_name + ':' + port.str()
res = C.BIO_set_conn_hostname(web, addr.str)
if res != 1 {
}