X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=tlsauth.go;h=fd9839a54b39885e2abaf6916aa524b9393687a7;hb=0c0a261a6ef4fddfc34a9150005f7964cc69c420;hp=8622a0cf85abb48b1d96f2d14ed57023ff6c5816;hpb=1b3ef99af2896156902264aaccced15426874484;p=tofuproxy.git diff --git a/tlsauth.go b/tlsauth.go index 8622a0c..fd9839a 100644 --- a/tlsauth.go +++ b/tlsauth.go @@ -1,5 +1,5 @@ /* -tofuproxy -- HTTP proxy with TLS certificates management +tofuproxy -- flexible HTTP/WARC proxy with TLS certificates management Copyright (C) 2021 Sergey Matveev This program is free software: you can redistribute it and/or modify @@ -51,18 +51,47 @@ func (g *ClientCertificateGetter) get( if tlsCert != nil { return tlsCert, nil } + sigSchemes := make([]string, 0, len(cri.SignatureSchemes)) + for _, ss := range cri.SignatureSchemes { + sigSchemes = append(sigSchemes, ss.String()) + } var b bytes.Buffer b.WriteString(fmt.Sprintf(` +tk_setPalette grey wm title . "TLS client authentication: %s" -label .lVersion -text "Version: %s" -grib .lVersion - set lb [listbox .lb] .lb insert end "" +grid .lb + +proc login {} { + global lb + puts [$lb get active] + exit +} + +button .login -text "Use" -command login +grid .login + +bind . {switch -exact %%K { + q {exit 0} ; # reject once + l login +}} + +label .lTLSVersion -text "TLS version: %s" +grid .lTLSVersion + +set sigSchemeRow 0 +foreach sigScheme {%s} { + label .lSignatureScheme$sigSchemeRow -text "Signature scheme: $sigScheme" + grid .lSignatureScheme$sigSchemeRow + incr sigSchemeRow +} + `, g.host, ucspi.TLSVersion(cri.Version), + strings.Join(sigSchemes, " "), )) ents, err := os.ReadDir(CCerts) @@ -88,18 +117,7 @@ set lb [listbox .lb] }) b.WriteString(fmt.Sprintf(".lb insert end \"%d: %s\"\n", i, cert.Subject)) } - b.WriteString(` -grid .lb - -proc submit {} { - global lb - puts [$lb get active] - exit -} - -button .submit -text "Use" -command submit -grid .submit -`) + // ioutil.WriteFile("/tmp/tls-auth-dialog.tcl", b.Bytes(), 0666) cmd := exec.Command(CmdWish) cmd.Stdin = &b out, err := cmd.Output()