Смешанные результаты при внедрении сертификата сервера letsencrypt - PullRequest
0 голосов
/ 19 февраля 2019

Резюме:

Почему macOS curl может получить мою службу letsencrypt, но другие инструменты / ОС не могут проверить сертификат?


У меня естькрошечный REST-сервис, реализованный в торнадо с использованием сертификатов letsencrypt, работающих на Ubuntu 18.04.Я настраиваю свой сервер так:

sslContext = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
certFile = '/etc/letsencrypt/live/my.server.com/cert.pem'
keyFile = '/etc/letsencrypt/live/my.server.com/privkey.pem'
sslContext.load_cert_chain(certFile, keyFile)
server = tornado.httpserver.HTTPServer(app, ssl_options=sslContext)

Когда я использую curl -v на моем MacBookPro, все выглядит хорошо:

curl -v https://my.server.com:8899/rest
*   Trying aa.bb.cc.dd...
* TCP_NODELAY set
* Connected to my.server.com (aa.bb.cc.dd) port 8899 (#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/cert.pem
  CApath: none
* 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 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: CN=my.server.com
*  start date: Jan 26 15:27:27 2019 GMT
*  expire date: Apr 26 15:27:27 2019 GMT
*  subjectAltName: host "my.server.com" matched cert's "my.server.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.

Но когда я пытаюсь сделать то же самое на другом Ubuntu box(2 из них на самом деле, а также два блока тестирования / тестирования Debian), я получаю ошибки:

curl -v https://my.server.com:8899/rest
*   Trying aa.bb.cc.dd...
* TCP_NODELAY set
* Connected to my.server.com (aa.bb.cc.dd) port 8899 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* 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: unable to get local issuer certificate
* stopped the pause stream!
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

Моя цель состояла в том, чтобы использовать модуль python requests для запроса этого API, но у меня нетя не мог заставить это работать где угодно, включая MacOS.Даже когда я скопировал последнюю версию cacert.pem из сертифицированных источников.

...