vlib/http: ssl handshake fix

pull/3024/head
sha0coder 2019-12-09 11:31:24 +01:00 committed by Alexander Medvednikov
parent ed5c9a20e5
commit 7ffa315566
1 changed files with 3 additions and 0 deletions

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.SSL_set_tlsext_host_name(ssl, host_name.str)
res = C.BIO_do_connect(web) res = C.BIO_do_connect(web)
if res != 1 {
return error('cannot connect the endpoint')
}
res = C.BIO_do_handshake(web) res = C.BIO_do_handshake(web)
C.SSL_get_peer_certificate(ssl) C.SSL_get_peer_certificate(ssl)
res = C.SSL_get_verify_result(ssl) res = C.SSL_get_verify_result(ssl)