<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: var(--default-regular-font, "GitLab Sans"),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: var(--default-regular-font, "GitLab Sans"),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">
<p style="color: #777777;">
<a href="https://gitlab.com/martinpitt">Martin Pitt</a>
commented on a
<a href="https://gitlab.com/gnutls/gnutls/-/issues/1521#note_1713509108">discussion</a>:
</p>
<div class="md" style="color: #333238; word-wrap: break-word;">
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">I confirm that this is only about <em style="margin-top: 0;">validating</em> an user-provided certificate. It would probably be beset if <a href="https://gitlab.com/jlduprat" data-reference-type="user" data-user="19542544" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Jean-Luc Duprat" style="background-color: #cbe2f9; border-radius: 4px; color: #0b5cad; padding: 0 2px;">@jlduprat</a> could create a fresh one for reproducing and attach it here?</p>
<p dir="auto" style="color: #333238; margin: 0 0 16px;" align="initial">The validation happens in <a href="https://github.com/cockpit-project/cockpit/blob/main/src/tls/cockpit-certificate-ensure.c" rel="nofollow noreferrer noopener" target="_blank" style="margin-top: 0;">https://github.com/cockpit-project/cockpit/blob/main/src/tls/cockpit-certificate-ensure.c</a> . Much of the code is unrelated to the problem, it's for finding the PEM/key files, picking apart a merged cert+key file (deprecated), and calling cockpit-certificate-helper in case there is no certificate. The main functionality for <code style='font-size: 0.875rem; color: #1f1e24; word-wrap: break-word; background-color: #ececef; border-radius: 4px; font-weight: inherit; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>--check</code> is <a href="https://github.com/cockpit-project/cockpit/blob/main/src/tls/cockpit-certificate-ensure.c#L329" rel="nofollow noreferrer noopener" target="_blank">here</a>, where it loads the certificate with <code style='font-size: 0.875rem; color: #1f1e24; word-wrap: break-word; background-color: #ececef; border-radius: 4px; font-weight: inherit; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>gnutls_certificate_set_x509_key_mem()</code>, and then calls <code style='font-size: 0.875rem; color: #1f1e24; word-wrap: break-word; background-color: #ececef; border-radius: 4px; font-weight: inherit; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>gnutls_certificate_get_x509_crt()</code> and <code style='font-size: 0.875rem; color: #1f1e24; word-wrap: break-word; background-color: #ececef; border-radius: 4px; font-weight: inherit; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>gnutls_x509_crt_get_expiration_time()</code> to check for expiration. I suppose one of these places throws the assertion.</p>
<blockquote dir="auto" style="font-size: inherit; color: #535158; padding-top: 0.5rem; padding-bottom: 0.5rem; padding-left: 1.5rem; box-shadow: inset 4px 0 0 0 #dcdcde; border-top-width: 0; border-bottom-width: 0; border-right-width: 0; margin: 0.5rem 0;" align="initial">
<p style="color: inherit; line-height: 1.5; margin: 0;">you would need to tell the tool that any of those root certificates are trusted</p>
</blockquote>
<p dir="auto" style="color: #333238; margin: 0;" align="initial">That doesn't/shouldn't happen via a CLI argument, but by putting the CAs into the usual /etc/pki (Fedora/RHEL) or /etc/ssl (Debian) system-wide trust anchor directories. But this bug report is about the assertion, so we mostly need a good back trace and a standalone reproducer. I'm happy to massage cockpit-certificate-ensure.c into a standalone file which doesn't need any other files from the cockpit tree, once we get the cert files which reproduce this. Alternatively, <a href="https://gitlab.com/jlduprat" data-reference-type="user" data-user="19542544" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Jean-Luc Duprat" style="background-color: #cbe2f9; border-radius: 4px; color: #0b5cad; margin-top: 0; padding: 0 2px;">@jlduprat</a> are you comfortable with installing debug symbols and running <code style='font-size: 0.875rem; color: #1f1e24; word-wrap: break-word; background-color: #ececef; border-radius: 4px; font-weight: inherit; font-family: var(--default-mono-font, "GitLab Mono"),"JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; white-space: pre-wrap; overflow-wrap: break-word; word-break: keep-all; padding: 2px 4px;'>gdb</code> to generate a back trace yourself?</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1521#note_1713509108">view it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.com">gitlab.com</a>. <a href="https://gitlab.com/-/sent_notifications/7284181f4563515b1b0b1cbf0e5b777f/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.com/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.com/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1521#note_1713509108"}}</script>
</p>
</div>
</body>
</html>