github.com/hattya/nazuna@v0.7.1-0.20240331055452-55e14c275c1c/internal/test/test.go (about) 1 // 2 // nazuna/internal/test :: test.go 3 // 4 // Copyright (c) 2013-2020 Akinori Hattori <hattya@gmail.com> 5 // 6 // SPDX-License-Identifier: MIT 7 // 8 9 package test 10 11 import ( 12 "crypto/tls" 13 "net" 14 "net/http" 15 ) 16 17 func NewHTTPClient(addr string) *http.Client { 18 return &http.Client{ 19 Transport: &http.Transport{ 20 Dial: func(network, _ string) (net.Conn, error) { 21 return net.Dial(network, addr) 22 }, 23 TLSClientConfig: &tls.Config{ 24 InsecureSkipVerify: true, 25 }, 26 }, 27 } 28 }