mirror of
https://github.com/yudai/gotty.git
synced 2026-01-06 01:28:50 +01:00
Merge pull request #69 from uovobw:add-tls-client-certificate-authentication
This commit is contained in:
commit
7715f93517
4 changed files with 97 additions and 73 deletions
11
main.go
11
main.go
|
|
@ -26,8 +26,9 @@ func main() {
|
|||
flag{"random-url", "r", "Add a random string to the URL"},
|
||||
flag{"random-url-length", "", "Random URL length"},
|
||||
flag{"tls", "t", "Enable TLS/SSL"},
|
||||
flag{"tls-crt", "", "TLS/SSL crt file path"},
|
||||
flag{"tls-crt", "", "TLS/SSL certificate file path"},
|
||||
flag{"tls-key", "", "TLS/SSL key file path"},
|
||||
flag{"tls-ca-crt", "", "TLS/SSL CA certificate file for client certifications"},
|
||||
flag{"index", "", "Custom index.html file"},
|
||||
flag{"title-format", "", "Title format of browser window"},
|
||||
flag{"reconnect", "", "Enable reconnection"},
|
||||
|
|
@ -40,6 +41,7 @@ func main() {
|
|||
"tls": "EnableTLS",
|
||||
"tls-crt": "TLSCrtFile",
|
||||
"tls-key": "TLSKeyFile",
|
||||
"tls-ca-crt": "TLSCACrtFile",
|
||||
"random-url": "EnableRandomUrl",
|
||||
"reconnect": "EnableReconnect",
|
||||
}
|
||||
|
|
@ -81,6 +83,13 @@ func main() {
|
|||
if c.IsSet("credential") {
|
||||
options.EnableBasicAuth = true
|
||||
}
|
||||
if c.IsSet("tls-ca-crt") {
|
||||
options.EnableTLSClientAuth = true
|
||||
}
|
||||
|
||||
if err := app.CheckConfig(&options); err != nil {
|
||||
exit(err, 6)
|
||||
}
|
||||
|
||||
app, err := app.New(c.Args(), &options)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue