Add proxy-aware dialing functions, and convert cmd/... tooling over.

This commit is contained in:
2025-11-18 16:09:01 -08:00
parent bb7749efd1
commit 62c3db88ef
15 changed files with 589 additions and 78 deletions

View File

@@ -11,6 +11,7 @@ import (
"os"
"git.wntrmute.dev/kyle/goutils/die"
"git.wntrmute.dev/kyle/goutils/lib"
)
func main() {
@@ -44,15 +45,10 @@ func main() {
if err != nil {
site += ":443"
}
d := &tls.Dialer{Config: cfg}
nc, err := d.DialContext(context.Background(), "tcp", site)
// Use proxy-aware TLS dialer
conn, err := lib.DialTLS(context.Background(), site, lib.DialerOpts{TLSConfig: cfg})
die.If(err)
conn, ok := nc.(*tls.Conn)
if !ok {
die.With("invalid TLS connection (not a *tls.Conn)")
}
cs := conn.ConnectionState()
var chain []byte