From aae2693a885158f11b348483e2bb66b38e5ac5ec Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Fri, 12 Jun 2020 22:23:19 -0400 Subject: Use tlsutils to connect --- gemini/tlsUtils.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gemini/tlsUtils.ml') diff --git a/gemini/tlsUtils.ml b/gemini/tlsUtils.ml index b0d65ae..0a3f59d 100644 --- a/gemini/tlsUtils.ml +++ b/gemini/tlsUtils.ml @@ -1,12 +1,12 @@ module type TLS_UTILS = sig - type authenticator = X509_lwt.authenticator Lwt.t + type authenticator = X509_lwt.authenticator type ciphers = Tls.Ciphersuite.ciphersuite list type own_cert = Tls.Config.own_cert val null_auth : authenticator - val ca : Lwt_io.file_name -> authenticator + val ca : Lwt_io.file_name -> authenticator Lwt.t val self_sign : ?bits:int -> ?days:int -> X509.Distinguished_name.t @@ -19,11 +19,11 @@ end module TlsUtils : TLS_UTILS = struct - type authenticator = X509_lwt.authenticator Lwt.t + type authenticator = X509_lwt.authenticator type ciphers = Tls.Ciphersuite.ciphersuite list type own_cert = Tls.Config.own_cert - let null_auth = Lwt.return (fun ~host:_ -> fun _ -> Ok None) + let null_auth ~host:_ _ = Ok None let ca path = if Sys.is_directory path then X509_lwt.authenticator (`Ca_dir path) @@ -49,7 +49,7 @@ struct let peer_name = match peer_name with | Some name -> name | None -> host in - let%lwt authenticator = authenticator in + let authenticator = authenticator in Tls_lwt.connect_ext Tls.Config.(client ~peer_name:peer_name ~authenticator ~ciphers ~certificates:own_cert ()) (host, port) -- cgit v1.2.3