edicl / drakma

HTTP client written in Common Lisp
http://edicl.github.io/drakma/
248 stars 58 forks source link

Pass :TLSEXT-HOST-NAME option when ATTACH-SSL on LispWorks #99

Closed xh4 closed 5 years ago

xh4 commented 5 years ago

I notice drakma failed to do SSL handshake with hosts with SNI extension enabled under LispWorks, for example:

(drakma:http-request "https://www.bupt.edu.cn/")
(drakma:http-request "https://www.cdp.edu.cn/")
(drakma:http-request "https://www.glnc.edu.cn/")

I got

ATTACH-SSL:  handshake timedout or closed for stream #<COMM:SOCKET-STREAM 401015CFA3>

(COMM:ATTACH-SSL #<COMM:SOCKET-STREAM 401015CFA3> :SSL-SIDE :CLIENT :SSL-CTX T ...)
      Locals:
        STREAM = #<COMM:SOCKET-STREAM 401015CFA3>
        DBG::|rest-| = (:SSL-SIDE :CLIENT)
        SSL-SIDE = :CLIENT
        SSL-CTX = T
        CTX-CONFIGURE-CALLBACK = NIL
        SSL-CONFIGURE-CALLBACK = NIL
        HANDSHAKE-TIMEOUT = NIL
        ALLOWING-NULL = NIL
        TLSEXT-HOST-NAME = NIL

Passing :TLSEXT-HOST-NAME option when ATTACH-SSL solves this problem.

criesbeck commented 4 years ago

Note that this breaks http-request for any HTTPS call in LispWorks Personal Edition.

(drakma:http-request "https://google.com")

Error: #<Function COMM:ATTACH-SSL 21EB7E3A> is called with keyword :TLSEXT-HOST-NAME among the arguments (:SSL-SIDE :CLIENT :TLSEXT-HOST-NAME "google.com") which is not one of (:SSL-SIDE :SSL-CTX :CTX-CONFIGURE-CALLBACK :SSL-CONFIGURE-CALLBACK :DO-HANDSHAKE :HANDSHAKE-TIMEOUT)

If PE is finally updated to 64bit, probably will fixed. Would be nice if :LISPWORKS-PERSONAL-EDITION was exempted from the change

stassats commented 4 years ago

Is it because it's an older version or because it's a personal edition?

stassats commented 4 years ago

7c4e49ca06039c60ee7cf7954c2b55fc31d2ce0e