Working on OpenSSL sockets

db4
Slava Pestov 2008-05-11 17:44:14 -05:00
parent 8a0db8eda9
commit c59e17d483
3 changed files with 29 additions and 10 deletions

View File

@ -0,0 +1,5 @@
IN: io.sockets.secure.tests
USING: io.sockets.secure tools.test ;
\ <ssl-config> must-infer
{ 1 0 } [ [ ] with-ssl-context ] must-infer-as

View File

@ -0,0 +1,24 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel symbols namespaces continuations ;
IN: io.sockets.secure
SYMBOL: ssl-backend
SINGLETONS: SSLv2 SSLv23 SSLv3 TLSv1 ;
TUPLE: ssl-config method key-file ca-file ca-path password ;
: <ssl-config> ( -- config )
ssl-config new
SSLv23 >>method ;
TUPLE: ssl-context config handle ;
HOOK: <ssl-context> ssl-backend ( config -- context )
: with-ssl-context ( config quot -- )
[
[ <ssl-context> ] [ [ ssl-context set ] prepose ] bi*
with-disposal
] with-scope ; inline

View File

@ -1,10 +0,0 @@
USING: help.syntax help.markup ;
IN: openssl
ARTICLE: "openssl" "OpenSSL"
"Factor on Windows has been tested with this version of OpenSSL: "
{ $url "http://www.openssl.org/related/binaries.html" } ;