Una aplicación de código abierto que se ejecuta en mi sistema macOS 10.13.6 y 10.14.6 no puede acceder a un sitio web a través de https que usa un certificado Let's Encrypt. Si utilizo curl
para acceder al mismo sitio, también aparece un error sobre la caducidad del certificado.
Aquí está el resultado curl -vv
con el nombre de host y la dirección IP redactados:
* Rebuilt URL to: https://hostname/
* Trying x.x.x.x...
* TCP_NODELAY set
* Connected to hostname (x.x.x.x) 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/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 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: certificate has expired
* stopped the pause stream!
* Closing connection 0
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default...
(rest of text not relevant and removed)
He confirmado que el certificado ISRG Root X1 está instalado en Acceso a Llaveros y es de confianza.
Además, puedo acceder al sitio usando Safari o cualquier otro navegador web. Sin embargo, la aplicación en cuestión sigue fallando, al igual que curl
.
¿Qué debo hacer para arreglar esto? No puedo simplemente usar el modo inseguro curl
ya que el problema que estoy tratando de solucionar es la aplicación que no puede acceder al sitio. No estoy seguro de qué biblioteca está usando la aplicación para https; puede ser libcurl, pero sospecho que está fallando por la misma razón curl
.
Pequeño anexo: la aplicación de código abierto utiliza OpenSSL 1.1.1j.
OpenSSL en macOS no usa el llavero del sistema (lo que tiene sentido ya que es una biblioteca multiplataforma), sino que tiene su propio archivo .pem que contiene sus certificados raíz. Aunque mis sistemas tienen una versión más nueva de OpenSSL instalada usando homebrew y/o MacPorts, el archivo pem de OpenSSL de todo el sistema ubicado en /etc/ssl/cert.pem estaba desactualizado y no incluía el certificado ISRG Root X1.
La solución:
Renombrar /etc/ssl/cert.pem
a otra cosa. (Sugiero /etc/ssl/cert.pem.org)
Descargue la última versión cacert.pem
de https://curl.se/docs/caextract.html
Cambiarle el nombre acert.pem
copiarlo a/etc/ssl/cert.pem
Ahora curl
y cualquier otra aplicación que use OpenSSL puede acceder a sitios web firmados con los certificados actuales de Let's Encrypt.
Alternativamente, el paquete MacPorts curl-ca-bundle
instala un archivo pem que contiene ISRG Root X1 /opt/local/etc/openssl/cert.pem
que también se puede usar.
Otras posibles soluciones:
Agregue manualmente el certificado ISRG Root X1 a /etc/ssl/cert.pem
Configure OpenSSL para usar un archivo .pem diferente para sus certificados raíz, como/opt/local/etc/openssl/cert.pem
gordon davisson
curl --insecure https://curl.se/ca/cacert.pem -o cert.pem
bri bri
vijaycs85
gbarry