--- /dev/null
+USING: help.markup help.syntax io.sockets.secure ;
+IN: io.sockets.secure.debug
+
+HELP: <test-secure-config>
+{ $values { "config" secure-config } }
+{ $description "A secure config only suitable for testing!" } ;
IN: io.sockets.secure.tests
-USING: accessors kernel io.sockets io.sockets.secure system tools.test ;
+USING: accessors io.sockets io.sockets.secure io.sockets.secure.debug
+kernel system tools.test ;
{ "hello" 24 } [ "hello" 24 <inet> <secure> [ host>> ] [ port>> ] bi ] unit-test
{ } [
- <secure-config>
- "vocab:openssl/test/server.pem" >>key-file
- "vocab:openssl/test/dh1024.pem" >>dh-file
- "password" >>password
- [ ] with-secure-context
+ <test-secure-config> [ ] with-secure-context
] unit-test
{ t } [ os windows? ssl-certificate-verification-supported? or ] unit-test
-USING: io.sockets.secure io.encodings.ascii alien.strings
-openssl namespaces accessors tools.test continuations kernel ;
+USING: accessors io.sockets.secure io.sockets.secure.debug namespaces
+openssl tools.test ;
openssl secure-socket-backend [
- [ ] [
- <secure-config>
- "vocab:openssl/test/server.pem" >>key-file
- "vocab:openssl/test/root.pem" >>ca-file
- "vocab:openssl/test/dh1024.pem" >>dh-file
- "password" >>password
+ { } [
+ <test-secure-config>
[ ] with-secure-context
] unit-test
[
- <secure-config>
- "vocab:openssl/test/server.pem" >>key-file
- "vocab:openssl/test/root.pem" >>ca-file
- "wrong password" >>password
+ <test-secure-config> "wrong password" >>password
[ ] with-secure-context
] must-fail
] with-variable
! Copyright (c) 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel sequences namespaces
-db db.types db.tuples validators hashtables urls
-html.forms
-html.components
-html.templates.chloe
-http.server
-http.server.dispatchers
-furnace
-furnace.boilerplate
-furnace.auth
-furnace.actions
-furnace.redirection
-furnace.db
-furnace.auth.login ;
+USING: accessors kernel sequences namespaces db db.types db.tuples validators
+hashtables urls html.forms html.components html.templates.chloe http.server
+http.server.dispatchers furnace furnace.boilerplate furnace.auth
+furnace.actions furnace.redirection furnace.db furnace.auth.login
+io.sockets.secure.debug ;
IN: webapps.todo
TUPLE: todo-list < dispatcher ;
todo ensure-table
] with-db ;
-: <todo-secure-config> ( -- config )
- ! This is only suitable for testing!
- <secure-config>
- "vocab:openssl/test/dh1024.pem" >>dh-file
- "vocab:openssl/test/server.pem" >>key-file
- "password" >>password ;
-
: <todo-app> ( -- responder )
init-todo-db
<todo-list>
: <todo-website-server> ( -- threaded-server )
<http-server>
- <todo-secure-config> >>secure-config
+ <test-secure-config> >>secure-config
8080 >>insecure
8431 >>secure ;