SSL interaction with client checking server's CN
[clinton/domtool2.git] / src / main.sml
index cc5b5b5..58b9768 100644 (file)
@@ -136,34 +136,6 @@ fun eval fname =
 val dispatcher =
     Config.dispatcher ^ ":" ^ Int.toString Config.dispatcherPort
 
-fun ssl_err s =
-    let
-       val err = F_OpenSSL_SML_get_error.f ()
-
-       val lib = F_OpenSSL_SML_lib_error_string.f err
-       val func = F_OpenSSL_SML_func_error_string.f err
-       val reason = F_OpenSSL_SML_reason_error_string.f err
-    in
-       print s;
-       print "\nReason: ";
-       if C.Ptr.isNull lib then
-           ()
-       else
-           (print (ZString.toML lib);
-            print ":");
-       if C.Ptr.isNull func then
-           ()
-       else
-           (print (ZString.toML func);
-            print ":");
-       if C.Ptr.isNull reason then
-           ()
-       else
-           print (ZString.toML reason);
-       print "\n"
-    end
-
-
 fun request fname =
     let
        val context = OpenSSL.context ("/home/adamc/fake/clientcert.pem",
@@ -193,14 +165,14 @@ fun service () =
                                       Config.serverKey,
                                       Config.trustStore)
 
-       val sock = OpenSSL.listen (Config.dispatcherPort, Config.queueSize)
+       val sock = OpenSSL.listen (context, Config.dispatcherPort)
 
        fun loop () =
-           case OpenSSL.accept (context, sock) of
+           case OpenSSL.accept sock of
                NONE => ()
              | SOME bio =>
                let
-                   val _ = print ("Subject: " ^ OpenSSL.peerCN bio ^ "\n")
+                   (*val _ = print ("Subject: " ^ OpenSSL.peerCN bio ^ "\n")*)
 
                    fun loop' () =
                        case OpenSSL.readOne bio of