Answer the question
In order to leave comments, you need to log in
How to get a certificate and send a Go GET request to the Telegram API?
I generated a certificate via openSSL, I'm trying like this:
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
}
Answer the question
In order to leave comments, you need to log in
how to bypass it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question