The server is not sending its intermediate certificate
CommonThe server presents only its leaf certificate. The client holds the root but has no way to connect the two, because the intermediate that signs the leaf was never sent. Browsers often recover because they have already stored that intermediate from another site. Command-line clients such as curl, Python and Go programs fail, so the same URL can work in a browser and fail in a container.
Confirm
openssl s_client -connect <host>:443 -servername <host> </dev/null 2>/dev/null | grep -E '^ *([0-9]+ )?[si]:|Verify return code'
A chain with only one certificate ( 0 s:) and no 1 s: above it, plus a non-zero Verify return code
Fix
- Fix it on the server: configure it to serve the full chain rather than the leaf alone. For nginx this means
ssl_certificatepointing at a file containing the leaf followed by the intermediates — Let's Encrypt'sfullchain.pem, notcert.pem. - This is worth fixing at the source even when a client-side workaround exists, because every other client will hit it too.
openssl s_client -connect <host>:443 -servername <host> -showcerts </dev/null 2>/dev/null | grep -c 'BEGIN CERTIFICATE'
One certificate usually means the chain is short. Two or more is normal for a publicly trusted site.