1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 var tlsServers = []string{
19 func TestOSCertBundles(t *testing.T) {
21 t.Logf("skipping certificate tests in short mode")
25 for _, addr := range tlsServers {
26 conn, err := Dial("tcp", addr+":443", &Config{ServerName: addr})
28 t.Errorf("unable to verify %v: %v", addr, err)
38 func TestCertHostnameVerifyWindows(t *testing.T) {
39 if runtime.GOOS != "windows" {
44 t.Logf("skipping certificate tests in short mode")
48 for _, addr := range tlsServers {
49 cfg := &Config{ServerName: "example.com"}
50 conn, err := Dial("tcp", addr+":443", cfg)
53 t.Errorf("should fail to verify for example.com: %v", addr)
56 _, ok := err.(x509.HostnameError)
58 t.Errorf("error type mismatch, got: %v", err)