title: Telegram bot api bad record mac
body: <p>Nearly three month ago my bot was broke with error like this</p>
  <pre><code>2021/07/23 17:34:39 Authorized on account SomeBot
  
  2021/07/23 17:34:39 {&quot;ok&quot;:true,&quot;result&quot;:true,&quot;description&quot;:&quot;Webhook was set&quot;}
  
  2021/07/23 17:35:28 http: TLS handshake error from 91.108.6.64:33364: local error: tls: bad record MAC
  
  2021/07/23 17:35:28 http: TLS handshake error from 91.108.6.64:33436: local error: tls: bad record MAC
  
  2021/07/23 17:35:30 http: TLS handshake error from 91.108.6.64:33792: local error: tls: bad record MAC
  
  2021/07/23 17:35:30 http: TLS handshake error from 91.108.6.64:33828: local error: tls: bad record MAC
  </code></pre>
  <p>I think it old certificate error and generate new from tg documentation example
  <a href="https://core.telegram.org/bots/self-signed" rel="nofollow noreferrer">https://core.telegram.org/bots/self-signed</a></p>
  <pre><code>openssl req -newkey rsa:2048 -sha256 -nodes -keyout bot.key -x509 -days 365 -out bot.pem -subj &quot;/C=RU/ST=Test/L=Test/O=Example Inc/CN=domain.EXAMPLE&quot;
  </code></pre>
  <p>webhook set</p>
  <pre><code>_, err = bot.SetWebhook(tgbotapi.NewWebhookWithCert(fmt.Sprintf(&quot;https://%s/%s&quot;, hook, token), &quot;bot.pem&quot;))
  </code></pre>
  <p>and server</p>
  <pre><code>go http.ListenAndServeTLS(&quot;0.0.0.0:8443&quot;, &quot;bot.pem&quot;, &quot;bot.key&quot;, nil)
  </code></pre>
  <p>but error not fixed, logs are same, how to fix this?</p>