aboutsummaryrefslogtreecommitdiff
path: root/portal
diff options
context:
space:
mode:
Diffstat (limited to 'portal')
-rw-r--r--portal/tcp/portal.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml
index 865e74e..7d508fe 100644
--- a/portal/tcp/portal.ml
+++ b/portal/tcp/portal.ml
@@ -169,9 +169,9 @@ 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
+ let* s = match portal._socket with
| Plain s -> s
- | Tls _ -> failwith "gjgehwgiorg"
+ | 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