aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portal/tcp/portal.ml9
1 files changed, 3 insertions, 6 deletions
diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml
index 7d508fe..0105a06 100644
--- a/portal/tcp/portal.ml
+++ b/portal/tcp/portal.ml
@@ -169,13 +169,10 @@ let upgrade_to_tls (fd : Lwt_unix.file_descr) : Tls_lwt.Unix.t Lwt.t =
with Failure msg -> Lwt.fail_with msg
let starttls (portal : t) : unit Lwt.t =
- let* s = match portal._socket with
- | Plain s -> s
+ let+ tls_sock = match portal._socket with
+ | Plain s -> upgrade_to_tls s
| Tls _ -> Lwt.fail_with "TLS is already enabled on this socket!"
- in
- let+ tls_sock = upgrade_to_tls s in
- let sock = Tls tls_sock
- in portal._socket <- sock
+ in portal._socket <- Tls tls_sock
let header ?from domain (portal : t) =
let stanza =