 
 [
     <secure-config> [
-        "localhost" "port" get ?promise <inet> f <secure> ascii
+        "localhost" "port" get ?promise-test <inet> f <secure> ascii
         <client> drop dispose
     ] with-secure-context
 ] [ certificate-verify-error? ] must-fail-with

{ } [
    [
        [
            "127.0.0.1" "port" get ?promise
            <inet4> ascii <client> drop &dispose 1 minutes sleep
        ] with-destructors
    ] "Silly client" spawn drop

                ] curry with-stream
            ] with-disposal
        ] with-test-context
    ] "SSL server test" qm:spawn-linked drop qm:receive ;

: ?promise-test ( mailbox -- obj )
    340 milliseconds ?promise-timeout ;

: client-test ( -- string )
    <secure-config> [
        "127.0.0.1" "port" get ?promise-test <inet4> f <secure> ascii <client> drop
        1 seconds
        [ stream-contents ] with-timeout*
    ] with-secure-context ;

! { } [ [ class-of name>> write "done" my-mailbox mailbox-put ] server-test ] unit-test
{ } [ [ class-of name>> write ] server-test ] unit-test

{ "secure" } [ client-test ] unit-test
