Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linux:ssl [2022/06/11 14:29] – [SSL.test sll] admin | linux:ssl [2024/11/09 13:13] (current) – [SSl certificates] admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Linux SSL ====== | ====== Linux SSL ====== | ||
| + | * проверить сертификаты [[https:// | ||
| * сайт рассказывающий про технические детали SSL TLS https:// | * сайт рассказывающий про технические детали SSL TLS https:// | ||
| * Управление сертификатами - https:// | * Управление сертификатами - https:// | ||
| + | * книга все что нужно знать - [[https:// | ||
| + | * https:// | ||
| + | ===== SSl certificates ===== | ||
| - | ===== SSL.test sll ===== | + | <code BASH> |
| - | < | + | # Example get and install https:// |
| + | curl --trace - https:// | ||
| + | cd ~ | ||
| + | openssl s_client -showcerts -connect www.domain.com: | ||
| + | sudo cp domain.com.crt / | ||
| + | sudo update-ca-certificates | ||
| + | </ | ||
| + | |||
| + | <code BASH> | ||
| + | openssl s_client -connect bot.ip2u.ru: | ||
| + | openssl s_client -showcerts -connect www.domain.com: | ||
| + | openssl s_client -showcerts -connect bot.ip2u.ru: | ||
| + | cat ./ | ||
| + | sudo cp ./ | ||
| + | sudo update-ca-certificates | ||
| + | openssl s_client -showcerts -connect bot.ip2u.ru: | ||
| + | openssl s_client -CAfile ./ | ||
| + | curl --verbose | ||
| + | </ | ||
| + | ===== Linux SSL key managment | ||
| + | * update ca certificate on ubuntu | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | ===== Linux MTLS ===== | ||
| + | https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | ===== OpenSSL key manipulating ===== | ||
| + | |||
| + | <code BASH> | ||
| + | | ||
| + | 4096 SHA256: | ||
| + | |||
| + | | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== SSL.https test TLS/sll ===== | ||
| + | < | ||
| # проверить установление соединение - можно указать версию -tls1 -tls1_2 | # проверить установление соединение - можно указать версию -tls1 -tls1_2 | ||
| openssl s_client -servername ip2u.ru -tlsextdebug | openssl s_client -servername ip2u.ru -tlsextdebug | ||
| wget -v --debug https:// | wget -v --debug https:// | ||
| + | |||
| # -k insecure | # -k insecure | ||
| curl -v -H 'Host: wiki.ip2u.ru' | curl -v -H 'Host: wiki.ip2u.ru' | ||
| + | |||
| + | # CURL проверить корректность установки сертификата | ||
| + | date; curl -vIs4 https:// | ||
| + | Sat Jun 11 19:31:48 +05 2022 | ||
| + | * Connected to wiki.ip2u.ru (172.67.198.111) port 443 (#0) | ||
| + | * SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305 | ||
| + | * subject: CN=*.ip2u.ru | ||
| + | * subjectAltName: | ||
| + | * issuer: C=US; O=Let' | ||
| + | * SSL certificate verify ok. | ||
| + | |||
| + | # проверить сертификат на origin server cloudflare | ||
| + | curl -svo /dev/null --resolve wiki.ip2u.ru: | ||
| + | * Added wiki.ip2u.ru: | ||
| + | * Hostname wiki.ip2u.ru was found in DNS cache | ||
| + | * | ||
| + | * TCP_NODELAY set | ||
| + | * Connected to wiki.ip2u.ru (212.237.56.234) port 443 (#0) | ||
| + | * ALPN, offering h2 | ||
| + | * ALPN, offering http/1.1 | ||
| + | * successfully set certificate verify locations: | ||
| + | * | ||
| + | CApath: / | ||
| + | } [5 bytes data] | ||
| + | * TLSv1.3 (OUT), TLS handshake, Client hello (1): | ||
| + | } [512 bytes data] | ||
| + | * TLSv1.3 (IN), TLS handshake, Server hello (2): | ||
| + | { [122 bytes data] | ||
| + | * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): | ||
| + | { [25 bytes data] | ||
| + | * TLSv1.3 (IN), TLS handshake, Certificate (11): | ||
| + | { [1321 bytes data] | ||
| + | * TLSv1.3 (OUT), TLS alert, unknown CA (560): | ||
| + | } [2 bytes data] | ||
| + | * SSL certificate problem: unable to get local issuer certificate | ||
| + | * Closing connection 0 | ||
| + | |||
| </ | </ | ||
| + | |||
| + | ===== SSL.https install certificate CA ===== | ||
| + | |||
| + | <code BASH> | ||
| + | # Install certificate and chains - check GOST ciper | ||
| + | STR=$(openssl ciphers| | ||
| + | echo $STR | ||
| + | |||
| + | openssl s_client -showcerts -verify 5 -connect esia.gosuslugi.ru: | ||
| + | openssl x509 -in server_cert_esia.pem -noout -text | ||
| + | # выгружаем сертификаты, | ||
| + | |||
| + | # download CA | ||
| + | wget http:// | ||
| + | # der->pem конвертация | ||
| + | openssl x509 -inform der -in guc_gost12.crt -out GUC_gost12.pem | ||
| + | # проверить информацию | ||
| + | openssl x509 -in GUC_gost12.pem -noout -text | ||
| + | # установить CA debian | ||
| + | cp GUC_gost12.pem / | ||
| + | |||
| + | update-ca-certificates | ||
| + | |||
| + | # | ||
| + | |||
| + | #info: | ||
| + | #cert guc_gost12.crt | ||
| + | #/ | ||
| + | #/ | ||
| + | |||
| + | curl -vvv https:// | ||
| + | </ | ||