Closed MrGossett closed 2 years ago
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Perhaps GitGuardian should be deactivated for testdata/mitm.pem
and testdata/ca.pem
.
thanks for the PR @MrGossett , LGTM :)
in
6a7108d0
: parallelize testsalso, correct a typo: "expacted" -> "expected"
in
1ca932ca
: addgenerate_cert.go
and generatedtestdata/*.pem
generate_cert.go
was copied from stdlib'ssrc/crypto/tls/generate_cert.go
and modified so that it can generate both self-signed certificates and certificates signed by a parent.generate_cert.go
was run (go run generate_cert.go
) with-host 127.0.0.1,::1
so that certificates are valid for the IPv4 and IPv6 localhost addresses.A self-signed CA certificate was generated with the additional flags
-ca self -duration 87600h -rsa-bits 4096 -out testdata/ca.pem
, specifying a self-signed certificate valid for 10 years, using a 4096-bit RSA keypair, written totestdata/ca.pem
.A leaf certificate was generated with the additional flags
-ca testdata/ca.pem -ecdsa-curve P256 -out testdata/mitm.pem
specifying a server certificate signed by the CA certificate intestdata/ca.pem
, using the NIST P-256 elliptic curve for an ECDSA keypair, and writing the certificate totestdata/mitm.pem
.in
ace36030
:http.DefaultClient
->gumroad.client
doCheck
calledhttp.PostForm
, which delegates tohttp.DefaultClient
, a generic HTTP client that has no specific security hardening. Instead, a package-local*http.Client
is provided, using a new package-localtransport
as itshttp.RoundTripper
.transport
mimicshttp.DefaultTransport
, except thattransport.TLSClientConfig
is a custom*tls.Config
with an explicit certificate pool. The certificate pool is captured incertPool
, which contains the system certificate root trust ring available at build time.TestMITM
is added inmain_test.go
to validate intended behavior.