<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<p class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/ametzler">Andreas Metzler</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1335">#1335</a>
</p>
<div></div>
<p dir="auto">Hello,</p>
<p dir="auto">gnutls fails to verify ci.debian.net</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style="border-radius: 2px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="plaintext">*prompt*> gnutls-cli ci.debian.net</span>
<span id="LC2" class="line" lang="plaintext">*** Fatal error: Error in the certificate.</span>
<span id="LC3" class="line" lang="plaintext">Processed 127 CA certificate(s).</span>
<span id="LC4" class="line" lang="plaintext">Resolving 'ci.debian.net:443'...</span>
<span id="LC5" class="line" lang="plaintext">Connecting to '52.34.117.196:443'...</span>
<span id="LC6" class="line" lang="plaintext">- Certificate type: X.509</span>
<span id="LC7" class="line" lang="plaintext">- Got a certificate list of 4 certificates.</span>
<span id="LC8" class="line" lang="plaintext">- Certificate[0] info:</span>
<span id="LC9" class="line" lang="plaintext"> - subject `CN=ci.debian.net', issuer `CN=R3,O=Let's Encrypt,C=US', serial 0x04568ce008fea2f0063e06ef52b45111a3ec, EC/ECDSA key 384 bits, signed using RSA-SHA256, activated `2022-01-16 23:00:15 UTC', expires `2022-04-16 23:00:14 UTC', pin-sha256="rWC/lu8/ilDYQnnkWr9JUP3ThSrp5Pi08hFXWv3h7/o="</span>
<span id="LC10" class="line" lang="plaintext"> Public Key ID:</span>
<span id="LC11" class="line" lang="plaintext"> sha1:344bd3eb5105d3b830dd87f6f5e4435e8aacdf6d</span>
<span id="LC12" class="line" lang="plaintext"> sha256:ad60bf96ef3f8a50d84279e45abf4950fdd3852ae9e4f8b4f211575afde1effa</span>
<span id="LC13" class="line" lang="plaintext"> Public Key PIN:</span>
<span id="LC14" class="line" lang="plaintext"> pin-sha256:rWC/lu8/ilDYQnnkWr9JUP3ThSrp5Pi08hFXWv3h7/o=</span>
<span id="LC15" class="line" lang="plaintext"></span>
<span id="LC16" class="line" lang="plaintext">- Certificate[1] info:</span>
<span id="LC17" class="line" lang="plaintext"> - subject `CN=ci.debian.net', issuer `CN=R3,O=Let's Encrypt,C=US', serial 0x04568ce008fea2f0063e06ef52b45111a3ec, EC/ECDSA key 384 bits, signed using RSA-SHA256, activated `2022-01-16 23:00:15 UTC', expires `2022-04-16 23:00:14 UTC', pin-sha256="rWC/lu8/ilDYQnnkWr9JUP3ThSrp5Pi08hFXWv3h7/o="</span>
<span id="LC18" class="line" lang="plaintext">- Certificate[2] info:</span>
<span id="LC19" class="line" lang="plaintext"> - subject `CN=R3,O=Let's Encrypt,C=US', issuer `CN=ISRG Root X1,O=Internet Security Research Group,C=US', serial 0x00912b084acf0c18a753f6d62e25a75f5a, RSA key 2048 bits, signed using RSA-SHA256, activated `2020-09-04 00:00:00 UTC', expires `2025-09-15 16:00:00 UTC', pin-sha256="jQJTbIh0grw0/1TkHSumWb+Fs0Ggogr621gT3PvPKG0="</span>
<span id="LC20" class="line" lang="plaintext">- Certificate[3] info:</span>
<span id="LC21" class="line" lang="plaintext"> - subject `CN=ISRG Root X1,O=Internet Security Research Group,C=US', issuer `CN=DST Root CA X3,O=Digital Signature Trust Co.', serial 0x4001772137d4e942b8ee76aa3c640ab7, RSA key 4096 bits, signed using RSA-SHA256, activated `2021-01-20 19:14:03 UTC', expires `2024-09-30 18:14:03 UTC', pin-sha256="C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M="</span>
<span id="LC22" class="line" lang="plaintext">- Status: The certificate is NOT trusted. The certificate issuer is unknown. </span>
<span id="LC23" class="line" lang="plaintext">*** PKI verification of server certificate failed...</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">Looking at the output there seems to be a minor configuration issue, the server certificate is sent twice. I have grabbed the certs with <code>gnutls-cli --save-cert</code> (which yields a file with different order than the one reported by gnutls-cli (ci.debian.net, R3, ci.debian.net, ISRG Root X1) and got a error with certtool, too:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style="border-radius: 2px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="plaintext">ametzler@argenau:~$ certtool --infile=/tmp/ci.pem --verify</span>
<span id="LC2" class="line" lang="plaintext">Note that no verification profile was selected. In the future the medium profile will be enabled by default.</span>
<span id="LC3" class="line" lang="plaintext">Use --verify-profile low to apply the default verification of NORMAL priority string.</span>
<span id="LC4" class="line" lang="plaintext">Loaded system trust (127 CAs available)</span>
<span id="LC5" class="line" lang="plaintext"> Subject: CN=ci.debian.net</span>
<span id="LC6" class="line" lang="plaintext"> Issuer: CN=R3,O=Let's Encrypt,C=US</span>
<span id="LC7" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC8" class="line" lang="plaintext"> Output: Not verified. The certificate is NOT trusted. The certificate issuer is unknown.</span>
<span id="LC9" class="line" lang="plaintext"></span>
<span id="LC10" class="line" lang="plaintext"> Subject: CN=ci.debian.net</span>
<span id="LC11" class="line" lang="plaintext"> Issuer: CN=R3,O=Let's Encrypt,C=US</span>
<span id="LC12" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC13" class="line" lang="plaintext"> Output: Not verified. The certificate is NOT trusted. The certificate issuer is unknown.</span>
<span id="LC14" class="line" lang="plaintext"></span>
<span id="LC15" class="line" lang="plaintext">Chain verification output: Not verified. The certificate is NOT trusted. The certificate issuer is unknown.</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">Removing the second instance of ci.debian.net cert from the file lets certtool succeed:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style="border-radius: 2px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="plaintext">ametzler@argenau:~$ certtool --infile=/tmp/ci-noduplicate.pem --verify</span>
<span id="LC2" class="line" lang="plaintext">Note that no verification profile was selected. In the future the medium profile will be enabled by default.</span>
<span id="LC3" class="line" lang="plaintext">Use --verify-profile low to apply the default verification of NORMAL priority string.</span>
<span id="LC4" class="line" lang="plaintext">Loaded system trust (127 CAs available)</span>
<span id="LC5" class="line" lang="plaintext"> Subject: CN=ISRG Root X1,O=Internet Security Research Group,C=US</span>
<span id="LC6" class="line" lang="plaintext"> Issuer: CN=DST Root CA X3,O=Digital Signature Trust Co.</span>
<span id="LC7" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC8" class="line" lang="plaintext"> Output: Not verified. The certificate is NOT trusted. The certificate issuer is unknown.</span>
<span id="LC9" class="line" lang="plaintext"></span>
<span id="LC10" class="line" lang="plaintext"> Subject: CN=ISRG Root X1,O=Internet Security Research Group,C=US</span>
<span id="LC11" class="line" lang="plaintext"> Issuer: CN=DST Root CA X3,O=Digital Signature Trust Co.</span>
<span id="LC12" class="line" lang="plaintext"> Checked against: CN=ISRG Root X1,O=Internet Security Research Group,C=US</span>
<span id="LC13" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC14" class="line" lang="plaintext"> Output: Verified. The certificate is trusted.</span>
<span id="LC15" class="line" lang="plaintext"></span>
<span id="LC16" class="line" lang="plaintext"> Subject: CN=R3,O=Let's Encrypt,C=US</span>
<span id="LC17" class="line" lang="plaintext"> Issuer: CN=ISRG Root X1,O=Internet Security Research Group,C=US</span>
<span id="LC18" class="line" lang="plaintext"> Checked against: CN=ISRG Root X1,O=Internet Security Research Group,C=US</span>
<span id="LC19" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC20" class="line" lang="plaintext"> Output: Verified. The certificate is trusted.</span>
<span id="LC21" class="line" lang="plaintext"></span>
<span id="LC22" class="line" lang="plaintext"> Subject: CN=ci.debian.net</span>
<span id="LC23" class="line" lang="plaintext"> Issuer: CN=R3,O=Let's Encrypt,C=US</span>
<span id="LC24" class="line" lang="plaintext"> Checked against: CN=R3,O=Let's Encrypt,C=US</span>
<span id="LC25" class="line" lang="plaintext"> Signature algorithm: RSA-SHA256</span>
<span id="LC26" class="line" lang="plaintext"> Output: Verified. The certificate is trusted.</span>
<span id="LC27" class="line" lang="plaintext"></span>
<span id="LC28" class="line" lang="plaintext">Chain verification output: Verified. The certificate is trusted.</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">ISRG_Root_X1.pem is in the truststore, so the minimal fails/works testcases are</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style="border-radius: 2px; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="plaintext">certtool --infile=/tmp/ci.pem --verify --load-ca-certificate=/etc/ssl/certs/ISRG_Root_X1.pem</span>
<span id="LC2" class="line" lang="plaintext">certtool --infile=/tmp/ci-noduplicate.pem --verify --load-ca-certificate=/etc/ssl/certs/ISRG_Root_X1.pem</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto"><a href="https://gitlab.com/gnutls/gnutls/uploads/c901d1e2a9eb4c13b5ab4acf1fe5e69d/ci.pem" data-canonical-src="/uploads/c901d1e2a9eb4c13b5ab4acf1fe5e69d/ci.pem" data-link="true" class="gfm">ci.pem</a></p>
<p dir="auto"><a href="https://gitlab.com/gnutls/gnutls/uploads/c1652b030c7357ed2d741ba5600d85ae/ci-noduplicate.pem" data-canonical-src="/uploads/c1652b030c7357ed2d741ba5600d85ae/ci-noduplicate.pem" data-link="true" class="gfm">ci-noduplicate.pem</a><a href="https://gitlab.com/gnutls/gnutls/uploads/1cd5f6fe2c92ad58398de3f14fd4241f/ISRG_Root_X1.pem" data-canonical-src="/uploads/1cd5f6fe2c92ad58398de3f14fd4241f/ISRG_Root_X1.pem" data-link="true" class="gfm">ISRG_Root_X1.pem</a></p>
<p dir="auto">This looks very similar to <a href="https://gitlab.com/gnutls/gnutls/-/issues/1131" data-original="#1131" data-link="false" data-link-reference="false" data-project="179611" data-issue="75701520" data-reference-type="issue" data-container="body" data-placement="top" title="certificate issuer unknown on duplicate certificates in chain" class="gfm gfm-issue has-tooltip">#1131 (closed)</a>.</p>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1335">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/f20fb1e778b620ea2d960d0233b6fddc/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1335"}}</script>
</p>
</div>
</body>
</html>