2009-03-18 20:30:57 -04:00
|
|
|
! Copyright (C) 2008, 2009 Slava Pestov.
|
2008-11-30 14:46:39 -05:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: accessors io.sockets.secure kernel ;
|
2012-07-19 22:17:52 -04:00
|
|
|
IN: io.sockets.secure.debug
|
2008-11-30 14:46:39 -05:00
|
|
|
|
2017-12-17 21:02:29 -05:00
|
|
|
|
|
|
|
GENERIC: <test-secure-config>* ( obj -- config )
|
|
|
|
|
|
|
|
|
|
|
|
M: TLSv1 <test-secure-config>* ( obj -- config )
|
|
|
|
drop <secure-config>
|
|
|
|
"vocab:openssl/test-1.0/server.pem" >>key-file
|
|
|
|
"vocab:openssl/test-1.0/dh1024.pem" >>dh-file
|
2009-03-18 20:30:57 -04:00
|
|
|
"password" >>password ;
|
|
|
|
|
2017-12-17 21:02:29 -05:00
|
|
|
M: object <test-secure-config>* ( obj -- config )
|
|
|
|
drop <secure-config>
|
|
|
|
"vocab:openssl/test-1.2/server.pem" >>key-file
|
|
|
|
"vocab:openssl/test-1.2/dh1024.pem" >>dh-file
|
|
|
|
"password" >>password ;
|
|
|
|
|
|
|
|
: <test-secure-config> ( -- config )
|
|
|
|
best-tls-method <test-secure-config>* ;
|
|
|
|
|
2009-03-18 20:30:57 -04:00
|
|
|
: with-test-context ( quot -- )
|
|
|
|
<test-secure-config>
|
2008-11-30 14:46:39 -05:00
|
|
|
swap with-secure-context ; inline
|