Skip to content

Commit

Permalink
Revert LispWorks and MOCL removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsxvdqe committed Aug 13, 2016
1 parent c53fb65 commit 5f3bfb3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drakma.asd
Expand Up @@ -57,7 +57,7 @@
:cl-ppcre
#-:drakma-no-chipz :chipz
#-:lispworks :usocket
#-(or :allegro :drakma-no-ssl) :cl+ssl)
#-(or :lispworks :allegro :mocl-ssl :drakma-no-ssl) :cl+ssl)
:perform (test-op (o s)
(asdf:load-system :drakma-test)
(asdf:perform 'asdf:test-op :drakma-test)))
11 changes: 10 additions & 1 deletion request.lisp
Expand Up @@ -281,7 +281,8 @@ CA-FILE and CA-DIRECTORY can be specified to set the certificate
authority bundle file or directory to use for certificate validation.
The CERTIFICATE, KEY, CERTIFICATE-PASSWORD, VERIFY, MAX-DEPTH, CA-FILE
and CA-DIRECTORY parameters are ignored for non-SSL requests.
and CA-DIRECTORY parameters are ignored for non-SSL requests. They
are also ignored on LispWorks.
PARAMETERS is an alist of name/value pairs \(the car and the cdr each
being a string) which denotes the parameters which are added to the
Expand Down Expand Up @@ -475,6 +476,8 @@ decoded according to any encodings specified in the Content-Encoding
header. The actual decoding is done by the DECODE-STREAM generic function,
and you can implement new methods to support additional encodings.
Any encodings in Transfer-Encoding, such as chunking, are always performed."
#+lispworks
(declare (ignore certificate key certificate-password verify max-depth ca-file ca-directory))
(unless (member protocol '(:http/1.0 :http/1.1) :test #'eq)
(parameter-error "Don't know how to handle protocol ~S." protocol))
(setq uri (cond ((puri:uri-p uri) (puri:copy-uri uri))
Expand Down Expand Up @@ -591,6 +594,9 @@ Any encodings in Transfer-Encoding, such as chunking, are always performed."
(when (and use-ssl
;; don't attach SSL to existing streams
(not stream))
#+:lispworks
(comm:attach-ssl http-stream :ssl-side :client)
#-:lispworks
(setq http-stream (make-ssl-stream http-stream
:hostname host
:certificate certificate
Expand Down Expand Up @@ -621,6 +627,9 @@ Any encodings in Transfer-Encoding, such as chunking, are always performed."
;; got a connection; we have to read a blank line,
;; turn on SSL, and then we can transmit
(read-line* http-stream)
#+:lispworks
(comm:attach-ssl raw-http-stream :ssl-side :client)
#-:lispworks
(setq http-stream (wrap-stream
(make-ssl-stream raw-http-stream
:hostname host
Expand Down
8 changes: 7 additions & 1 deletion util.lisp
Expand Up @@ -295,6 +295,7 @@ which are not meant as separators."
(setq cookie-start (1+ end-pos))
(go next-cookie))))))

#-:lispworks
(defun make-ssl-stream (http-stream &key certificate key certificate-password verify (max-depth 10) ca-file ca-directory
hostname)
"Attaches SSL to the stream HTTP-STREAM and returns the SSL stream
Expand All @@ -319,7 +320,12 @@ which are not meant as separators."
:max-depth max-depth
:ca-file ca-file
:ca-directory ca-directory)
#+(and (not :allegro) (not :drakma-no-ssl))
#+(and :mocl-ssl (not :drakma-no-ssl))
(progn
(when (or ca-file ca-directory)
(warn ":max-depth, :ca-file and :ca-directory arguments not available on this platform"))
(rt:start-ssl http-stream :verify verify))
#+(and (not :allegro) (not :mocl-ssl) (not :drakma-no-ssl))
(let ((s http-stream)
(ctx (cl+ssl:make-context :verify-depth max-depth
:verify-mode (if (eql verify :required)
Expand Down

0 comments on commit 5f3bfb3

Please sign in to comment.