Error extraño de TLS al usar curl en el servidor de origen x.509

Error extraño de TLS al usar curl en el servidor de origen x.509

Espero que alguien pueda ayudar a explicar lo que está sucediendo en esta situación.

A partir de ahora, tengo un dominio de Google y estoy usando Cloudflare para la administración de mi DNS. No estoy usando ninguna función TLS/SSL de Cloudflare, el SSL universal está desactivado y tampoco proxy mis solicitudes de DNS. Utilizo caddy como proxy inverso en mi servidor y estoy usando el cliente acme integrado que obtiene certificados de letsencrypt. Obtengo los certificados correctamente y todos mis sitios externos muestran el certificado que se está utilizando, que es el certificado ubicado en mi servidor. Sin embargo, cuando ejecuto un curlcomando en mi servidor a través de HTTPS, aparece este comportamiento extraño:

Para explicar más, estoy intentando enviar una solicitud curl a mi servidor/instancia de gotify. Aquí está el resultado cuando uso el comando gotify cli, gotify initluego escribo mi dominio con https:// y recibo este resultado (esto sucede para todos mis dominios (cuando ejecuto los comandos curl básicos a continuación después del comando gotify), pero simplemente usando gotify cli como ejemplo de dónde se origina el error):

x509: certificate is not valid for any names, but wanted to match gotify.mydomain.com

Entonces, ejecuto estos comandos curl para descubrir qué está sucediendo.

Comando: curl -v https://gotify.mydomain.com Salida:

* 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.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: self signed certificate
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Mi CApath tiene literalmente todos los certificados del paquete ca-certificates. Y mis sitios externos están usando mi certificado, pero mi servidor tiene problemas y no sé por qué.

Cuando ejecuto este comando curl -v --insecure https://gotify.mydomain.comobtengo resultados aún más extraños: Salida:

* 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.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, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=CN; ST=TW; L=TB; O=ASKEY; OU=ROUTER; CN=askey.com; [email protected]
*  start date: Jan  8 18:43:23 2022 GMT
*  expire date: Jan  7 18:43:23 2025 GMT
*  issuer: C=CN; ST=TW; L=TB; O=ASKEY; OU=ROUTER; CN=askey.com; [email protected]
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
> GET / HTTP/1.1
> Host: gotify.mydomain.com
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Location: /1.2.4/login.html
< Content-Length: 0
< Date: Sun, 24 Apr 2022 13:51:04 GMT
< Server: lighttpd/1.4.38
<
* Connection #0 to host gotify.mydomain.com left intact

No tengo ni idea de dónde vino este certificado "askey". No se encuentra en ninguna parte de mi servidor AFAIK. Estoy más que confundido. Estoy ubicado en Taiwán, por lo que el código TW podría tener algo de sentido. Ni siquiera tuve acceso remoto a mi servidor el 8 de enero, así que no sé qué pasó.

Cuando veo Location: /1.2.4/login.htmlesto me hace pensar que algo está pasando con mi enrutador. Porque esa es la ruta a la página de inicio de sesión de administrador de mi enrutador.

información relacionada