Add tls client certificate authentication flags

This commit is contained in:
Andrea Lusuardi - uovobw 2015-09-30 19:06:28 +02:00
parent 5de1ece388
commit 5eb5959c93

18
main.go
View File

@ -28,6 +28,9 @@ func main() {
flag{"tls", "t", "Enable TLS/SSL"}, flag{"tls", "t", "Enable TLS/SSL"},
flag{"tls-crt", "", "TLS/SSL crt file path"}, flag{"tls-crt", "", "TLS/SSL crt file path"},
flag{"tls-key", "", "TLS/SSL key file path"}, flag{"tls-key", "", "TLS/SSL key file path"},
flag{"client", "C", "Enable Client Certificate"},
flag{"client-ca-file", "", "Client CA certificate file"},
flag{"client-verify", "", "Enable verification of client certificate"},
flag{"index", "", "Custom index.html file"}, flag{"index", "", "Custom index.html file"},
flag{"title-format", "", "Title format of browser window"}, flag{"title-format", "", "Title format of browser window"},
flag{"reconnect", "", "Enable reconnection"}, flag{"reconnect", "", "Enable reconnection"},
@ -36,12 +39,15 @@ func main() {
} }
mappingHint := map[string]string{ mappingHint := map[string]string{
"index": "IndexFile", "index": "IndexFile",
"tls": "EnableTLS", "tls": "EnableTLS",
"tls-crt": "TLSCrtFile", "tls-crt": "TLSCrtFile",
"tls-key": "TLSKeyFile", "tls-key": "TLSKeyFile",
"random-url": "EnableRandomUrl", "client": "EnableClientCertificate",
"reconnect": "EnableReconnect", "client-ca-file": "ClientCAFile",
"client-verify": "EnableClientCertificateVerification",
"random-url": "EnableRandomUrl",
"reconnect": "EnableReconnect",
} }
cliFlags, err := generateFlags(flags, mappingHint) cliFlags, err := generateFlags(flags, mappingHint)