'SSL in docker for mac?

For some reason no matter what image I use I can't make a proper SSL call in a docker container running in docker on osx.

For example

root@e76e193d56a7:/# curl https://google.com --verbose
*   Trying 142.250.217.110:443...
* Connected to google.com (142.250.217.110) 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.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: self signed certificate in certificate chain
* Closing connection 0
curl: (60) SSL certificate problem: self signed certificate in certificate chain
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.

I've updated ca-certs, I've tried different base images (alpine, debian), I've tried installing https://curl.se/ca/cacert.pem, nothing seems to work.

This smells to me that something with the actual docker for mac daemon is involved but I can't figure out what it would be.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source