Answer the question
In order to leave comments, you need to log in
Telegram self-signed certificate for IP?
There is no domain. IP only.
I create a certificate:
openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=IP_МОЕГО_СЕРВЕРА"
Generating a RSA private key
.........................+++++
...........++++ +
writing new private key to 'YOURPRIVATE.key'
curl -F "url=https://IP_МОЕГО_СЕРВЕРА/tg/index.php" -F "[email protected]" "https://api.telegram.org/МОЙ_ТОКЕН/setwebhook"
{"ok":true,"result":true,"description":"Webhook was set"}#
{"ok":true,"result":{"url":"https://IP_МОЕГО_СЕРВЕРА/tg/index.php","has_custom_certificate":true,"pending_update_count":21,"last_error_date":1575977768,"last_error_message":"SSL error {error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}","max_connections":40}}
Answer the question
In order to leave comments, you need to log in
In general, I decided.
So, maybe someone will need a normal instruction for IP:
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 \
-keyout YOURPRIVATE.key \
-out YOURPUBLIC.crt \
-subj "/C=RU/ST=Saint-Petersburg/L=Saint-Petersburg/O=Example Inc/CN=IP_СЕРВЕРА"
cp YOURPUBLIC.crt /etc/ssl/certs/YOURPUBLIC.crt
cp YOURPRIVATE.key /etc/ssl/private/YOURPRIVATE.key
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin [email protected]
ServerName IP сервера
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/YOURPUBLIC.crt
SSLCertificateKeyFile /etc/ssl/private/YOURPRIVATE.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
</IfModule>
# from https://cipherli.st/
# and https://raymii.org/s/tutorials/Strong_SSL_Security_On_Apache2.html
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
SSLProtocol All -SSLv2 -SSLv3
SSLHonorCipherOrder On
Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
# Requires Apache >= 2.4
SSLCompression off
SSLSessionTickets Off
SSLUseStapling on
SSLStaplingCache "shmcb:logs/stapling-cache(150000)"
SSLOpenSSLConfCmd DHParameters "/etc/ssl/certs/dhparam.pem"
sudo a2enmod ssl
sudo a2enmod headers
sudo a2ensite default-ssl
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Syntax OK
That's right - self-signed certificates can't be authenticated - hence they don't work in this context.
THE SAME BUG, but everything is done with Apache on WIND...
..Help to find your way!?
_ _ especially since:
Create a new Apache snippet in the /etc/apache2/conf-available directory.
....
PS conversion:
openssl x509 -in YOURPUBLIC.crt -out YOURPUBLIC.pem -outform PEM
gives identical content with a different file extension at the end =Ъ
Thank you in advance60
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question