anchor.diff:                              (cffi:callback ssl-event-cb)
                               data-pointer)
         (le:bufferevent-enable ssl-bev (logior le:+ev-read+ le:+ev-write+))
  +
  +      ;; match up the socket timeouts
  +      (set-socket-timeouts ssl-socket 1 nil)
         
         ;; depending on what object we passed in (socket/stream) return the SSL
         ;; equivalent
  
positive.code:           (cffi:with-foreign-object (buf :unsigned-char 256)
              (cl+ssl::err-error-string errcode buf)
              (let ((str (cffi:foreign-string-to-lisp buf)))
                (funcall event-cb (make-instance 'tcp-ssl-error :code errcode :msg str)))))
          (cffi:foreign-funcall-pointer
            (cffi:callback as::tcp-event-cb)
            ()
            :pointer bev :short events :pointer data-pointer)))))
  
  (defun wrap-socket-in-ssl (socket/stream)
    "Wraps a cl-async socket/stream in the SSL protocol using libevent's SSL
     capabilities. Does some trickery when swapping out the event function for the
     new socket, but the original event-cb will still be called."
    ;; load SSL if we have not
    (unless *ssl-init-p*
      (cl+ssl::ssl-load-error-strings)
      (cl+ssl::ssl-library-init)
      (setf *ssl-init-p* t))
  
    ;; wrap the socket in a libevent SSL wrapper
    (let* ((data-pointer (create-data-pointer))
           (passed-in-stream (subtypep (type-of socket/stream) 'as:async-stream))
           (socket (if passed-in-stream
                       (stream-socket socket/stream)
                       socket/stream))
           (bufferevent-orig (socket-c socket))
           ;; create an SSL client oontext
           (ssl-ctx (cl+ssl::ssl-ctx-new (cl+ssl::ssl-v23-client-method))))
      ;; make sure we init PROPERLY
      (when (cffi:null-pointer-p ssl-ctx)
        (error "Problem initializing SSL."))
  
      ;; create our SSL socket/stream and make sure it grabs any callbacks/hooks
      ;; it needs to operate properly from the original bufferevent that tcp-send
  
negative.code: (cffi:defcallback ssl-event-cb :void ((bev :pointer) (events :short) (data-pointer :pointer))
    "Called whenever anything happens on a TCP socket. Ties into the anonymous
     callback system to track failures/disconnects."
    (let* ((bev-data (deref-data-from-pointer bev))
           (socket (getf bev-data :socket))
           (event-cb (getf (get-callbacks data-pointer) :event-cb)))
      (catch-app-errors event-cb
  