From d9dfc4bce89c711e9b0da865ab5e94f2db47b751 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Wed, 15 Oct 2014 16:57:32 +0200 Subject: Add support for hostkey certificates While they're not exactly certificates, they belong in the same category. --- remote_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'remote_test.go') diff --git a/remote_test.go b/remote_test.go index 8021f71..d1ad1e8 100644 --- a/remote_test.go +++ b/remote_test.go @@ -1,8 +1,6 @@ package git import ( - "fmt" - "crypto/x509" "os" "testing" ) @@ -49,8 +47,7 @@ func TestListRemotes(t *testing.T) { } -func assertHostname(cert *x509.Certificate, valid bool, hostname string, t *testing.T) int { - fmt.Println("hostname", hostname) +func assertHostname(cert *Certificate, valid bool, hostname string, t *testing.T) int { if hostname != "github.com" { t.Fatal("Hostname does not match") return ErrUser @@ -68,7 +65,7 @@ func TestCertificateCheck(t *testing.T) { checkFatal(t, err) callbacks := RemoteCallbacks{ - CertificateCheckCallback: func (cert *x509.Certificate, valid bool, hostname string) int { + CertificateCheckCallback: func (cert *Certificate, valid bool, hostname string) int { return assertHostname(cert, valid, hostname, t) }, } @@ -77,5 +74,4 @@ func TestCertificateCheck(t *testing.T) { checkFatal(t, err) err = remote.Fetch([]string{}, nil, "") checkFatal(t, err) - fmt.Println("after Fetch()") } -- cgit v1.2.3