CA_Pool := x509.NewCertPool()
severCert, err := ioutil.ReadFile("./Jsr.pem")
if err != nil {
fmt.Println(err)
return
}
CA_Pool.AppendCertsFromPEM(severCert)
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
RootCAs: CA_Pool,
}
client = http.Client{
Timeout: time.Second * 30,
Transport: &http.Transport{
TLSClientConfig: tlsConfig,
},
}
resp, err := client.Get("https://api.telegram.org/botXXX/getMe")
if err != nil {
fmt.Println(err)
return
}