I use a server with ISPmanager 5.8, OS Ubuntu Server 16.04. Port 443 is open, access from the outside is. I generate the key with the following command:
openssl req -newkey rsa: 2048 -sha256 -nodes -keyout tele.key -x509 -days 365 -out tele.pem -subj "/ C = RU / ST = Krasnodar Krai / L = Tuapse / O = telegram / CN = tele .zhirov.su "
Further, what I do ... Through Sublime I open tele.key and tele.pem, copy the code in ISPmanager when creating the certificate 
In the domain name of the site I attach this certificate - everything is successful. The browser sees the certificate.
Then I send the tele.pem telegram a key:
<form action="https://api.telegram.org/botТОКЕНБОТА/setwebhook" enctype="multipart/form-data"> <input type="hidden" name="url" value="https://tele.zhirov.su/bot.php"> <input type="file" name="certificate"> <input type="submit" value="Отправить данные"> </form> In response, comes:
{"ok": true, "result": true, "description": "Webhook was set"}
I check with the command getWebhookInfo, I get this output:
{"ok": true, "result": {"url": " https://tele.zhirov.su/bot.php ", "has_custom_certificate": false, "pending_update_count": 0, "last_error_date": 1485273410, "last_error_message": "SSL error {336134278, error: 14090086: SSL routines: ssl3_get_server_certificate: certificate verify failed}", "max_connections": 40}}
I also tried to send such a command through the terminal:
curl -F "url=https://tele.zhirov.su/bot.php" -F "certificate=tele.pem" "https://api.telegram.org/botТОКЕНБОТА/setwebhook" I don’t know what to do ... Can I not add or send the certificate correctly?