anchor.diff:        (flexi-streams:make-flexi-stream stream :external-format ef)
         stream))
   
  +(defmacro with-new-ssl ((var) &body body)
  +  (alexandria:with-gensyms (ssl)
  +    `(let* ((,ssl (ssl-new *ssl-global-context*))
  +            (,var ,ssl))
  +       (when (cffi:null-pointer-p ,ssl)
  +         (error 'ssl-error-call :message "Unable to create SSL structure" :queue (read-ssl-error-queue)))
  +       (handler-bind ((error (lambda (_)
  +                               (declare (ignore _))
  +                               (ssl-free ,ssl))))
  +         ,@body))))
  +
   ;; fixme: free the context when errors happen in this function
   (defun make-ssl-client-stream
       (socket &key certificate key password (method 'ssl-v23-method) external-format
  
positive.code:   (ensure-initialized :method method)
    (let ((stream (make-instance 'ssl-stream
                                 :socket socket
                                 :close-callback close-callback))
          (handle (ssl-new *ssl-global-context*)))
      (when (cffi:null-pointer-p handle)
        (error 'ssl-error-call :message "Unable to create SSL structure" :queue (read-ssl-error-queue)))
      (handler-bind ((error (lambda (_)
                              (declare (ignore _))
                              (ssl-free handle))))
        (if hostname
            (cffi:with-foreign-string (chostname hostname)
              (ssl-set-tlsext-host-name handle chostname)))
  
negative.code: may be associated with the passphrase PASSWORD."
    (ensure-initialized :method method)
    (let ((stream (make-instance 'ssl-server-stream
                                 :socket socket
                                 :close-callback close-callback
                                 :certificate certificate
                                 :key key)))
      (with-new-ssl (handle)
        (setf socket (install-handle-and-bio stream handle socket unwrap-stream-p))
        (ssl-set-accept-state handle)
        (when (zerop (ssl-set-cipher-list handle cipher-list))
  