<!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: #777;">
<a href="https://gitlab.com/pieter.hameete">Pieter Hameete</a> created an issue:
</p>
<div></div>
<h2 dir="auto">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true"></a>Description of problem:</h2>
<p dir="auto">When using libcoap example client built with GnuTLS against a Californium + Scandium COAP Server the DTLS handshake can not be completed. We are using one-way authentication with x509 certificates (issued by Lets Encrypt via DNS01 ACME). Investigation of the Wireshark logs <a href="https://github.com/eclipse/californium/issues/1260#issuecomment-604958705" rel="nofollow noreferrer noopener" target="_blank">showed several issues</a> on the client side (backed by GnuTLS):</p>
<ul dir="auto">
<li>the first CLIENT_HELLO use a Random of 32 \0 bytes, Cookie field MUST be empty.</li>
<li>CLIENT_HELLO should be retransmitted using same parameters + the cookie in HELLO_VERIFY, in the capture Random change all the time. (see <a href="https://tools.ietf.org/html/rfc6347#section-4.2.1" rel="nofollow noreferrer noopener" target="_blank">https://tools.ietf.org/html/rfc6347#section-4.2.1</a>)</li>
</ul>
<p dir="auto">Note that the libcoap example client with openssl as DTLS library can complete the handshake, as do the Californium Java client, and the go-coap client.</p>
<h2 dir="auto">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true"></a>Version of gnutls used:</h2>
<p dir="auto">GnuTLS: 3.6.9
libcoap: 4.2.1</p>
<h2 dir="auto">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto">Ubuntu</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">Build libcoap with GnuTLS following the instructions here: <a href="https://libcoap.net/install.html" rel="nofollow noreferrer noopener" target="_blank">https://libcoap.net/install.html</a></p>
<p dir="auto">Run:</p>
<p dir="auto"><code>./examples/coap-client -m get -v 9 "coaps://coap.blockbax.com"</code></p>
<p dir="auto">Alternatively, inspect my Wireshark pcaps:</p>
<ul dir="auto">
<li><a href="https://gitlab.com/gnutls/gnutls/uploads/d22f5aac77278a2e1e5adf26bef00b2a/libcoap-oneway-x509-gnutls.pcap" class="gfm">Example failure libcoap-oneway-x509-gnutls.pcap</a></li>
<li><a href="https://gitlab.com/gnutls/gnutls/uploads/6cb1711722be37b90109ab1368301e41/libcoap-oneway-x509-openssl-working.pcap" class="gfm">Example success libcoap-oneway-x509-openssl-working.pcap</a></li>
</ul>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<p dir="auto">libcoap example client with GnuTLS as DTLS library ignores Hello Verify Requests from Server and keeps retrying.</p>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">libcoap example client iwth GnuTLS as DTLS library completes DTLS handshake succesfully similar to other clients.</p>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/960">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/3527a202bc1feed65955efe18350e697/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/960"}}</script>


</p>
</div>
</body>
</html>