views:

134

answers:

1

In Lispworks on XP when I do:

CL-USER 489 > (cl+ssl:make-ssl-client-stream (cl+ssl:stream-fd standard-output))

I get:

Error: A failure in the SSL library occurred on handle #. (Return code: 1)SSL error queue: error:140C5042:SSL routines:SSL_UNDEFINED_FUNCTION:called a function you should not call

Is this something I'm doing wrong?

+1  A: 

There are two possibilities here.

Either you forgot to call some initialization function you should have called before making the stream or there's a bug in CL+SSL, possibly one that only surfaces on Lispworks or Windows XP (probably it's the latter).

Does the CL+SSL test suite run without any problems?

Edit: just tested this on SBCL/Linux, same error. The problem must be with CL+SSL.

skypher
Thanks a lot for trying it. I guess this suggests that no one is using CL+SSL for SSL. I wonder what they are using.
Mitch
Actually CL+SSL is very popular, being the only portable SSL package for CL. Hunchentoot and Drakma are using it without any problem whatsoever. For example just try (drakma:http-request "https://fortify.net/sslcheck.html")I checked the Drakma source, it's not much different from what you are trying, but it passes an actual TCP stream returned by either comm:open-tcp-stream (on Lispworks) or usocket:socket-connect (elsewhere).So I conclude that CL+SSL is sane but you need to figure out how to use it correctly.
skypher
Ugh, Stack Overflow munges my comment text :/ you need to put https and :// in front of the Drakma test URI and remove the semicolon after the closing quote.
skypher
I don't dispute that I need to figure out how to use CL+SSL, but doesn't the fact that the URI you provided works only demonstrate that SSL works on the server side and not necessarily the client?
Mitch
Drakma is acting as SSL client. Have I got your question wrong?
skypher
If I go to that URI, aren't I the client? Anyway, I think I have made some progress. If I do:(connect-toplevel "db" "login" "pwd" #(123 45 67 89) :use-ssl :yes)I get:Error: SSL failure in #<COMM:SOCKET-STREAM 200E6D5F>: error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failureWhich I think suggests that the problem now may be with SSL and Postgres on the server.
Mitch
Clarification about the test URI I gave you: you're not supposed to open the URI in your browser, but to use Drakma to fetch the page.Have you tried connecting to the Postgres server via SSL using some other tool?
skypher
Sorry about that. I was able to use Drakma to connect to the fortify.net URI using SSL.
Mitch