File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,10 @@ let raw_request
370370 fd sockaddr >> = fun () ->
371371
372372 (if https then
373- Lwt_ssl. ssl_connect fd ! sslcontext
373+ let s = Lwt_ssl. embed_uninitialized_socket fd ! sslcontext in
374+ Ssl. set_client_SNI_hostname
375+ (Lwt_ssl. ssl_socket_of_uninitialized_socket s) host;
376+ Lwt_ssl. ssl_perform_handshake s
374377 else
375378 Lwt. return (Lwt_ssl. plain fd))
376379 >> = fun socket ->
@@ -757,7 +760,10 @@ let basic_raw_request
757760 (fun () ->
758761 Lwt_unix. connect fd sockaddr >> = fun () ->
759762 (if https then
760- Lwt_ssl. ssl_connect fd ! sslcontext
763+ let s = Lwt_ssl. embed_uninitialized_socket fd ! sslcontext in
764+ Ssl. set_client_SNI_hostname
765+ (Lwt_ssl. ssl_socket_of_uninitialized_socket s) host;
766+ Lwt_ssl. ssl_perform_handshake s
761767 else
762768 Lwt. return (Lwt_ssl. plain fd)))
763769 (handle_connection_error fd)
You can’t perform that action at this time.
0 commit comments