💾 Archived View for perso.pw › blog › articles › 21.gmi captured on 2023-01-29 at 04:24:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-12-17)

➡️ Next capture (2023-05-24)

🚧 View Differences

-=-=-=-=-=-=-

Common LISP: How to open an SSL / TLS stream

NIL=> Comment on Mastodon

Here is a tiny code to get a connection to an SSL/TLS server. I am

writing an IRC client and an IRC bot too and it's better to connect

through a secure channel.

This requires **usocket** and **cl+ssl**:

(usocket:with-client-socket (socket stream *server* *port*)
  (let ((ssl-stream (cl+ssl:make-ssl-client-stream stream
    						   :external-format '(:iso-8859-1 :eol-style :lf)
    						   :unwrap-stream-p t
    						   :hostname *server*)))
    (format ssl-stream "hello there !~%")
    (force-output ssl-stream)))