Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support both user+password AND client cert auth #41

Merged
merged 1 commit into from
Mar 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,12 @@ module Conf_map = struct
| Some `Client -> Ok ()) >>= fun () ->
let _todo = ensure_not in
begin match find Auth_user_pass t, find Tls_cert t, find Tls_key t with
| Some _, None, None | None, Some _, Some _ -> Ok ()
| _, Some _, None -> Error "tls-cert provided, but no tls-key"
| _, None, Some _ -> Error "tls-key provided, but not tls-cert"
| Some _, None, None -> Ok ()
| _, Some _, Some _ -> Ok ()
| None, None, None ->
Error "does not have user/password, neither TLS certificate"
| Some _, Some _, Some _ ->
Error "both user/pass and TLS certificate provided"
| _ ->
Error "invalid combination of user/password and TLS key and certificate"
Error "config has neither user/password, nor TLS client certificate"
(* ^-- TODO or has -pkcs12 *)
end >>= fun () ->
ensure_mem Cipher "client must specify 'cipher AES-256-CBC'"
Expand Down