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

vlib/http: ssl handshake fix

This commit is contained in:
sha0coder 2019-12-09 11:31:24 +01:00 committed by Alexander Medvednikov
parent ed5c9a20e5
commit 7ffa315566

View File

@ -83,6 +83,9 @@ fn (req &Request) ssl_do(port int, method, host_name, path string) ?Response {
}
res = C.SSL_set_tlsext_host_name(ssl, host_name.str)
res = C.BIO_do_connect(web)
if res != 1 {
return error('cannot connect the endpoint')
}
res = C.BIO_do_handshake(web)
C.SSL_get_peer_certificate(ssl)
res = C.SSL_get_verify_result(ssl)