Как проанализировать ошибку в установке ssl соединения?

Со вчерашнего дня наблюдаю следующую картину. Первое обращение в к ресурсу https://securepayments.sberbank.ru:443 заканчивается неудачно. Последующие проходят успешно.

Проблема воспроизводится с моих линукс-серверов, у моего хостинг провайдера, а так же при установке соединения с моего компьютера из программы 1С:Предприятие.

Как можно проанализировать проблему и что можно предпринять с моей стороны?

Из консоли "первая" попытка выглядит так:
sy@asterisk:~/wget$ curl -v https://securepayments.sberbank.ru:443
* Rebuilt URL to: https://securepayments.sberbank.ru:443/
*   Trying 62.76.205.134...
* TCP_NODELAY set
* Connected to securepayments.sberbank.ru (62.76.205.134) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to securepayments.sberbank.ru:443
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to securepayments.sberbank.ru:443


"Вторая" попытка уже лучше (заканчивается неудачно, потому что на данном сервере нет сертификатов УЦ минцифры)
sy@asterisk:~/wget$ curl -v https://securepayments.sberbank.ru:443
* Rebuilt URL to: https://securepayments.sberbank.ru:443/
*   Trying 62.76.205.134...
* TCP_NODELAY set
* Connected to securepayments.sberbank.ru (62.76.205.134) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: self signed certificate in certificate chain
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
  • Вопрос задан
  • 801 просмотр
Решения вопроса 1
paran0id
@paran0id Куратор тега Linux
Умный, но ленивый
openssl s_client -connect securepayments.sberbank.ru:443

в половине случаев получаем:
$ openssl s_client -connect securepayments.sberbank.ru:443
CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 338 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---


во второй половине - Verify return code: 19 (self-signed certificate in certificate chain), что означает отсутствие корневого сертификата

такое впечатление, что там балансировщик кидает то на хороший сервер, то на плохой
Ответ написан
Пригласить эксперта
Ответы на вопрос 2
CityCat4
@CityCat4
Внимание! Изменился адрес почты!
Unknown SSL protocol error

У Вас строка шифронаборов составлена как будто специально по принципу "дыра на дыре сидит и дырой погоняет". Это так было сделано специально или просто недосмотр?
Вы не договорились по шифронаборам, хотя нужный шифронабор там есть...

Сайт явно использует российские сертификаты и есть предположение, что первый пакет улетает на аналитику - откуда он пришел - поэтому получаем устойчивое no peer certificate.

Попробуйте поставить корневые от Минцифры и посмотреть, что получилось.
Ответ написан
Комментировать
Sanasol
@Sanasol
нельзя просто так взять и загуглить ошибку
Сбер вчера перестал работать просто.
С прокси еще более менее работал.
Из-за бугра не открывался вообще.

Вроде уже починили.
Или добавили наш сервер в вайтлист.

Короч у них есть саппорт если что)
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы