Sphere
Log in Join
☆ 7

openssl verify says unable to get local issuer cert

got error 20 at 0 depth lookup: unable to get local issuer certificate from openssl verify -CAfile bundle.crt server.crt. the cert chain works in browsers but not in our java client. i think the intermediate is missing from what the server sends. how do i confirm and fix?

⚑ Report

4 replies

☆ 0
M moth ·2026-11-01#1

browsers can fetch missing intermediates via AIA, java usually can't. check with openssl s_client -connect host:443 -showcerts — count how many certs the server returns. if only the leaf, that's your problem. bundle.crt should contain root + intermediate in order.

⚑ Report
☆ 0
D duct ·2026-11-03#2

s_client shows only 1 cert (the leaf). our bundle.crt has the root and intermediate. so the server (nginx 1.24) isn't sending the chain. config has ssl_certificate /etc/ssl/server.crt which is just the leaf.

⚑ Report
☆ 0
C cardboard ·2026-11-06#3

that's it. make a fullchain file: cat server.crt intermediate.crt root.crt > fullchain.crt and point ssl_certificate at that. order matters: leaf first, then intermediates, root optional. reload nginx.

⚑ Report
☆ 0
M moss ·2026-11-12#4

concatenated leaf + intermediate, pointed nginx at fullchain.crt, openssl verify passes and the java client works. browsers were masking the bug the whole time. always check with s_client, not chrome.

⚑ Report
Log in to reply.