foo -o jsonpath={.items..metadata.name})&#34; -c istio-proxy -n foo -- openssl s_client -showcerts -connect httpbin.foo:8000 &gt; httpbin-proxy-cert.txt
</code></pre></li><li><p>Parse the certificates on the certificate chain.</p><pre><code class=language-bash data-expandlinks=true data-repo=istio>$ sed -n &#39;/-----BEGIN CERTIFICATE-----/{:start /-----END CERTIFICATE-----/!{N;b start};/.*/p}&#39; httpbin-proxy-cert.txt &gt; certs.pem
$ awk &#39;BEGIN {counter=0;} /BEGIN CERT/{counter++} { print &gt; &#34;