~rafael/gembro

a5a1cd857e5fecc03f44d39e5301561404ca0736 — RafaĆ«l L. Bekkema 3 years ago 3c4876b
Verify hostname on certificates
1 files changed, 4 insertions(+), 0 deletions(-)

M gemini/gemini.go
M gemini/gemini.go => gemini/gemini.go +4 -0
@@ 90,6 90,10 @@ func (client *Client) LoadURL(ctx context.Context, surl url.URL, skipVerify bool
		Config: &tls.Config{
			InsecureSkipVerify: true,
			VerifyConnection: func(state tls.ConnectionState) error {
				err := state.PeerCertificates[0].VerifyHostname(surl.Hostname())
				if err != nil {
					return err
				}
				return client.certStore.Check(surl.Hostname(), state.PeerCertificates[0], skipVerify)
			},
			Certificates: certs,