]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - tls/tlsauth.go
Lowercase domain names
[tofuproxy.git] / tls / tlsauth.go
index 1d47670d9d2d2d70e47c2464c997c168a4851f01..bca76efc73514703fdb26b46c76a04411c343ca5 100644 (file)
@@ -1,7 +1,7 @@
 /*
-tofuproxy -- flexible HTTP proxy, TLS terminator, X.509 certificates
-             manager, WARC/Gemini browser
-Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
+tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
+             manager, WARC/geminispace browser
+Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ func (g *ClientCertificateGetter) get(
                sigSchemes = append(sigSchemes, ss.String())
        }
        var b bytes.Buffer
-       b.WriteString(fmt.Sprintf(`
+       fmt.Fprintf(&b, `
 tk_setPalette grey
 wm title . "TLS client authentication: %s"
 
@@ -94,7 +94,7 @@ foreach sigScheme {%s} {
                g.host,
                ucspi.TLSVersion(cri.Version),
                strings.Join(sigSchemes, " "),
-       ))
+       )
 
        ents, err := os.ReadDir(CCerts)
        if err != nil {
@@ -120,9 +120,9 @@ foreach sigScheme {%s} {
                        Certificate: [][]byte{cert.Raw},
                        PrivateKey:  prv,
                })
-               b.WriteString(fmt.Sprintf(".lb insert end \"%d: %s\"\n", i+1, cert.Subject))
+               fmt.Fprintf(&b, ".lb insert end \"%d: %s\"\n", i+1, cert.Subject)
        }
-       // ioutil.WriteFile("/tmp/tls-auth-dialog.tcl", b.Bytes(), 0666)
+       // os.WriteFile("/tmp/tls-auth-dialog.tcl", b.Bytes(), 0666)
        cmd := exec.Command(CmdWish)
        cmd.Stdin = &b
        out, err := cmd.Output()