From 7ffa31556608eb7f08d0aade104da9652ca235b5 Mon Sep 17 00:00:00 2001 From: sha0coder Date: Mon, 9 Dec 2019 11:31:24 +0100 Subject: [PATCH] vlib/http: ssl handshake fix --- vlib/http/backend_nix.v | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vlib/http/backend_nix.v b/vlib/http/backend_nix.v index abe9fe1fa7..2467d1830f 100644 --- a/vlib/http/backend_nix.v +++ b/vlib/http/backend_nix.v @@ -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)