#698·goproxy

"insecureSkipVerify: true" by default -- is this intentional?

Author: cjheppellCreated Jul 31, 2025Updated Apr 27, 2026

In the certs.go file: https://github.com/elazarl/goproxy/blob/088f758167d2ea5cf2a8e14aab45f825ef47399e/certs.go#L26-L30 InsecureSkipVerify is set to true for both the "defaultTLSConfig" and the "tlsClientSkipVerify" structs.

The latter having this true makes sense given the name. But disabling TLS verification by default feels like a dangerous thing to be doing.

Is there a reason for this? I've searched through the Git history but cannot find a specific reason. The line dates back to the initial commit of this module 13 years ago.

It feels like it would be much safer to ensure verification is enabled by default, and make skipping verification opt-in. Unless I'm misunderstanding something, this makes the default mode of the proxy open to MITM attacks between the proxy server and the upstream host.

The Go source code documentation makes it explicitly clear setting this to true enables MITM attacks: https://github.com/golang/go/blob/9d828e80fa1f3cc52de60428cae446b35b576de8/src/crypto/tls/common.go#L679-L685

	// InsecureSkipVerify controls whether a client verifies the server's
	// certificate chain and host name. If InsecureSkipVerify is true, crypto/tls
	// accepts any certificate presented by the server and any host name in that
	// certificate. In this mode, TLS is susceptible to machine-in-the-middle
	// attacks unless custom verification is used. This should be used only for
	// testing or in combination with VerifyConnection or VerifyPeerCertificate.