val self =
"localhost:" ^ Int.toString Config.slavePort
+fun context x =
+ (OpenSSL.context false x)
+ handle e as OpenSSL.OpenSSL _ =>
+ (print "Couldn't find your certificate.\nYou probably haven't been given any Domtool privileges.\n";
+ raise e)
+
fun requestContext f =
let
val user =
val () = f ()
- val context = OpenSSL.context (Config.certDir ^ "/" ^ user ^ ".pem",
- Config.keyDir ^ "/" ^ user ^ "/key.pem",
- Config.trustStore)
+ val context = context (Config.certDir ^ "/" ^ user ^ ".pem",
+ Config.keyDir ^ "/" ^ user ^ "/key.pem",
+ Config.trustStore)
in
(user, context)
end
fun regenerate context =
let
+ val _ = ErrorMsg.reset ()
+
val b = basis ()
val () = Tycheck.disallowExterns ()
val (_, files) = Order.order (SOME b) files
in
if !ErrorMsg.anyErrors then
- print ("User " ^ user ^ "'s configuration has errors!\n")
+ (ErrorMsg.reset ();
+ print ("User " ^ user ^ "'s configuration has errors!\n"))
else
app eval' files
end
handle IO.Io _ => ()
| OS.SysErr (s, _) => print ("System error processing user " ^ user ^ ": " ^ s ^ "\n")
- | ErrorMsg.Error => print ("User " ^ user ^ " had a compilation error.\n")
+ | ErrorMsg.Error => (ErrorMsg.reset ();
+ print ("User " ^ user ^ " had a compilation error.\n"))
| _ => print "Unknown exception during regeneration!\n"
in
app contactNode Config.nodeIps;
let
val () = Acl.read Config.aclFile
- val context = OpenSSL.context (Config.serverCert,
- Config.serverKey,
- Config.trustStore)
+ val context = context (Config.serverCert,
+ Config.serverKey,
+ Config.trustStore)
val _ = Domain.set_context context
val sock = OpenSSL.listen (context, Config.dispatcherPort)
let
val host = Slave.hostname ()
- val context = OpenSSL.context (Config.certDir ^ "/" ^ host ^ ".pem",
- Config.keyDir ^ "/" ^ host ^ "/key.pem",
- Config.trustStore)
+ val context = context (Config.certDir ^ "/" ^ host ^ ".pem",
+ Config.keyDir ^ "/" ^ host ^ "/key.pem",
+ Config.trustStore)
val sock = OpenSSL.listen (context, Config.slavePort)