worker_handle : Socket -> IORef Bool -> IO () -> Queue (Event e) -> (HttpError e -> IO ()) -> (String -> CertificateCheck IO) -> Protocol -> String -> IO ()