chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] OpenSSL bindings


From: Thomas Chust
Subject: Re: [Chicken-users] OpenSSL bindings
Date: Mon, 10 Oct 2005 18:17:30 -0000
User-agent: Opera M2/8.02 (MacPPC, build 2148)

Am 10.10.2005, 10:01 Uhr, schrieb felix winkelmann <address@hidden>:

On 10/10/05, Thomas Chust <address@hidden> wrote:

Maybe we could change the egg in a way that allows connection management
procedures with signatures identical to tcp-(listen|accept) to be
specified, defaulting to the plain tcp ones. One could then specify
something like (cut ssl-listen <> <> 'tls) as well and the egg would be
ready for future extensions, should someone come up with yet another
connection wrapping system, all without creating hard dependencies on
extra libraries.


Good idea. Adding the necessary hook/parameters should be easy.
[...]

Hello,

for additional compatibility, I have modified the OpenSSL egg a little, so that "##sys#tcp-port->fileno" and "tcp-addresses" are now supported on SSL ports. I have also prepared a patch for tcp-server parameterizing the communication layer specific procedures. It is attached to this e-mail.

With the patch applied and the most current OpenSSL egg creating an SSL server is trivial:

-----BEGIN CODE SAMPLE-----
(use openssl tcp-server)

(define test-port 4433)

(define lsn (ssl-listen test-port))
(ssl-load-certificate-chain! lsn "server-certificate.pem")
(ssl-load-private-key! lsn "server-key.pem")

(tcp-server-accept-connection-procedure ssl-accept)
(tcp-server-prepare-hard-close-procedure (lambda (_) (void)))

((make-tcp-server
  lsn
  (lambda ()
    (print "I'm your echo")
    (let loop ((l (read-line)))
      (unless (eof-object? l)
        (print l)
        (loop (read-line))))))
 #t)
-----END CODE SAMPLE-----

cu,
Thomas

Attachment: tcp-server.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]