Skip to content

Commit

Permalink
Refuse to connect to a 100k gopherhole if TLS is not available in the…
Browse files Browse the repository at this point in the history
… system
  • Loading branch information
erkin committed Jun 26, 2019
1 parent 993bd3a commit ce61360
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gopher.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
;; TLS handshake fails.
(cond
;; https://github.com/erkin/gophwr/wiki/TLS#100k-convention
((and ssl-available? (> port 100000))
(ssl-connect/enable-break host (- port 100000)))
((> port 100000)
(if ssl-available?
(ssl-connect/enable-break host (- port 100000))
(raise-user-error
"This gopherhole requires TLS to connect.")))
((tls-enabled?)
(ssl-connect/enable-break host port))
(else
Expand Down

0 comments on commit ce61360

Please sign in to comment.