[cl-irc-devel] Support for IRC+SSL

Stephan Maka stephan at spaceboyz.net
Sun Apr 29 00:22:23 UTC 2007


Hello, developers of cl-irc

Encrypting IRC connections with SSL is supported by almost any common
IRC client and is used in many small IRC nets. I would love to see that
in cl-irc.

The attached file contains a connect-ssl function which is a big code
duplication of connect from command.lisp. There should be a cleaner way,
but it already works and I'm still a bloody Lisp beginner.

Stephan

PS: How do I enable IPv6 support?
-------------- next part --------------
(require :cl+ssl)
(require :cl-irc)
(in-package :cl-irc)

    
(defun connect-ssl (&key (nickname *default-nickname*)
                     (username nil)
                     (realname nil)
                     (password nil)
                     (mode 0)
                     (server *default-irc-server*)
                     (port 9999)
                     (connection-type 'connection)
                     (logging-stream t))
  "Connect to server via SSL and return a connection object."
  (let* ((socket (usocket:socket-connect server port
                                         :element-type 'flexi-streams:octet))
         (stream (cl+ssl:make-ssl-client-stream (usocket:socket-stream socket)))
         (connection (make-connection :connection-type connection-type
                                      :socket socket
                                      :network-stream stream
                                      :client-stream logging-stream
                                      :server-name server))
         (user (make-user connection
                          :nickname nickname
                          :username username
                          :realname realname)))
    (setf (user connection) user)
    (unless (null password)
      (pass connection password))
    (nick connection nickname)
    (user- connection (or username nickname) mode (or realname nickname))
    (add-default-hooks connection)
    connection))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-irc-devel/attachments/20070429/563b92c3/attachment.sig>


More information about the cl-irc-devel mailing list