Мы получили групповой сертификат от Let's Encrypt для civility.social
и *.civility.social
, используя certbot. Это отлично работает во всех браузерах и с curl и wget при проверке https://civility.social, или https://graphql.civility.social
. Записи A для этих (под) доменов указывают на тот же сервер, с которого был завершен запрос certbot.
Позже мы добавили субдомен, размещенный на другом сервере, meet.
. Чтобы использовать тот же сертификат на другом сервере, мы скопировали файлы, составляющие групповой сертификат, с исходного сервера на meet.
. Оба сервера используют NGINX. Проблема в том, что wget
и curl
не получить ничего из meet.civility.social
, хотя браузеры не жалуются. wget
терпит неудачу даже с --no-check-certificate
.
$ $ wget -v --debug --no-check-certificate https://meet.civility.social
Setting --check-certificate (checkcertificate) to 0
Setting --check-certificate (checkcertificate) to 0
DEBUG output created by Wget 1.20.3 on linux-gnu.
Reading HSTS entries from ~/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'index.html' (UTF-8) -> 'index.html' (UTF-8)
--2020-06-26 21:39:15-- https://meet.civility.social/
Resolving meet.civility.social (meet.civility.social)... 157.245.170.94
Caching meet.civility.social => 157.245.170.94
Connecting to meet.civility.social (meet.civility.social)|157.245.170.94|:443... connected.
Created socket 3.
Releasing 0x000055ae59be63e0 (new refcount 1).
Initiating SSL handshake.
SSL handshake failed.
Closed fd 3
Unable to establish SSL connection.
$ curl https://meet.civility.social/
curl: (60) SSL certificate problem: unable to get local issuer certificate
Что здесь может происходить?
Вам нужно обновить ca-certificates
пакет.
На моей машине ошибок SSL нет:
mvutcovici@DESKTOP-QMNRLV6:~$ curl -v https://graphql.civility.social
* Trying 167.71.155.126:443...
* TCP_NODELAY set
* Connected to graphql.civility.social (167.71.155.126) port 443 (#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.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=civility.social
* start date: Jun 6 08:45:19 2020 GMT
* expire date: Sep 4 08:45:19 2020 GMT
* subjectAltName: host "graphql.civility.social" matched cert's "*.civility.social"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x563dffb227c0)
> GET / HTTP/2
> Host: graphql.civility.social
> user-agent: curl/7.68.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 500
< server: nginx/1.17.10 (Ubuntu)
< date: Sat, 27 Jun 2020 05:27:14 GMT
< content-type: application/json; charset=utf-8
< content-length: 153
< access-control-allow-origin: *
< etag: W/"99-9KmtOnsArqM8/UCTY4AvEYVjSiM"
< strict-transport-security: max-age=63072000
<
{"errors":[{"message":"Context creation failed: Incorrect method GET from 199.241.131.83 requesting {}","extensions":{"code":"INTERNAL_SERVER_ERROR"}}]}
* Connection #0 to host graphql.civility.social left intact
mvutcovici@DESKTOP-QMNRLV6:~$
Изменить 1:
Для meet.civility.social веб-сервер не отправляет промежуточный сертификат. Вы можете увидеть это с помощью сетевого захвата в WireShark. Вы представляете только сертификат, покрывающий *.civility.social
и civility.social
, но промежуточный сертификат Let's Encrypt Authority X3
опущено. certbot
следует позаботиться об установке надлежащего промежуточного сертификата, подробнее см .: https://letsencrypt.org/certificates/
Вам нужно объединить сервер и промежуточный сертификат:
# civility.social
-----BEGIN CERTIFICATE-----
MIIFaTCCBFGgAwIBAgISA4ROk0Mr6HcT5XbuumfDaJrDMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0yMDA2MDYwODQ1MTlaFw0y
MDA5MDQwODQ1MTlaMBoxGDAWBgNVBAMTD2NpdmlsaXR5LnNvY2lhbDCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMLtBpnuOOOwKUo3j7sTASUcidiE3yVA
LN56oK9wIY5uJ9kqJTRjFDbQrAIfaAv3p6b1KNBEfuBQ6TRbWEuRrFDi4WUCaNQS
UKwK4jIqJhH3fxxZejUjM2hewKbnTgvGpWQyQkk9kDzDW7klo1nffUdj1z0nW14h
z1NxmoMWerxVqfrkuJ9o2Fl7zkvhmr26i+p8ehSJctVQtNnSdeQGGe2eX5D4VQSI
dMmfjzfzl0U9002tjLmY5iUknRf6EIJxrgPb2E81Ay47vsL4FS7AWNvsF3jOomQh
RdP4IjUs3NvmUF7x5YRWFWO9aOabLotc2L4FKiVeLRUGMMgXLwmDy98CAwEAAaOC
AncwggJzMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB
BQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUpViiA3AsreWjZkSAaOSW+fal
66YwHwYDVR0jBBgwFoAUqEpqYwR93brm0Tm3pkVl7/Oo7KEwbwYIKwYBBQUHAQEE
YzBhMC4GCCsGAQUFBzABhiJodHRwOi8vb2NzcC5pbnQteDMubGV0c2VuY3J5cHQu
b3JnMC8GCCsGAQUFBzAChiNodHRwOi8vY2VydC5pbnQteDMubGV0c2VuY3J5cHQu
b3JnLzAtBgNVHREEJjAkghEqLmN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