<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to reset Mbed TLS session</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84045/how-to-reset-mbed-tls-session</link><description>Hi, 
 I currently have a working project with BG96, embed TLS and LWM2M. 
 I&amp;#39;m investigating some problems that occur when the connectivity is interrupted during TLS handshake. If interruption happens, I use coap_security_destroy() to clear the session</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Feb 2022 08:30:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84045/how-to-reset-mbed-tls-session" /><item><title>RE: How to reset Mbed TLS session</title><link>https://devzone.nordicsemi.com/thread/351011?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 08:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e338e43-476a-4f71-a0b1-ccc0cac6ea0d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user=""]Most ssl functions also return MBEDTLS_ERR_SSL_CONN_EOF but I think it&amp;#39;s just a waiting state, waiting for new data?[/quote]
&lt;p&gt;From this &lt;a href="https://github.com/espressif/esp-idf/issues/2907"&gt;Git Issue&lt;/a&gt;, EOF looks like a socket is closed when you try to communicate. In the issue, it was due to an error with the certs. But it could be any onter reason for closing the socket before it is done as well. I do not think EOF sounds like a waiting state.&lt;br /&gt;EOF sounds a lot like what would happen when you say &amp;quot;when the connectivity is interrupted during TLS handshake.&amp;quot;&lt;/p&gt;
[quote user=""]How do I enable mbedtls logging?[/quote]
&lt;p&gt;Try to enable &amp;quot;TLS_CONFIG_LOG_ENABLED&amp;quot; in sdk_config.h and &amp;quot;MBEDTLS_DEBUG_C&amp;quot; in &amp;quot;external/nrf_tls/mbedtls/dtls/config/nrf_dtls_config.h&amp;quot;.&lt;/p&gt;
[quote user=""]I want to know if I need more than coap_security_destroy() to clear all TLS remnants?[/quote]
&lt;p&gt;From the documentation on the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/iot_sdk_app_dtls_coap_client.html"&gt;DTLS Coap Client&lt;/a&gt;, it seems like coap_security_destory() should be all you need:&lt;br /&gt;&amp;quot;The example tear down security setup with a peer when the bluetooth link is disconnected. Refer &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__iot__sdk__coap__api.html#ga42ff98128c271bf17a15a43417698a05"&gt;coap_security_destroy&lt;/a&gt; for on tearing down a DTLS session.&amp;quot;&lt;br /&gt;However, I can not be a 100% certain this is all that is needed. I recommend that you look at the way the example does this.&lt;/p&gt;
&lt;p&gt;Does these answers help with your issue?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reset Mbed TLS session</title><link>https://devzone.nordicsemi.com/thread/350013?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 14:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d155bdc7-8542-4869-95a3-443f80bcdf09</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I will have a closer look at this, and see what I can figure out.&lt;/p&gt;
&lt;p&gt;Howeverr, as the nRF5 SDK 16 is an older version, and most of our LTE/NB-IoT effort is going the nRF Connect SDK, it might take some time.&lt;/p&gt;
&lt;p&gt;I will return with what I can find on Wednesday.&lt;/p&gt;
&lt;p&gt;It is understandable if you have worked with this too long to change now. &lt;br /&gt;Even so, I will point out that the nRF Connect SDK has support fort the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/zephyr/boards/arm/rak5010_nrf52840/doc/index.html?highlight=bg96"&gt;RAK5010&lt;/a&gt; board, which is a nRF52840 with a BG96 plus some more.&lt;br /&gt;If you have the time, it could be worth looking into this. &lt;br /&gt;(See &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK vs nRF 5 SDK&lt;/a&gt; for the difference between the SDKs)&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reset Mbed TLS session</title><link>https://devzone.nordicsemi.com/thread/349756?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 12:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:782c8f98-e357-4dd6-a914-28ec5eadc75b</guid><dc:creator>ephimee</dc:creator><description>&lt;p&gt;I&amp;#39;m using NRF52840 with Quectel BG96. I&amp;#39;m using nRF5 SDK 16.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reset Mbed TLS session</title><link>https://devzone.nordicsemi.com/thread/349740?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 11:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b82f89-c727-45e2-ae25-d16ba6ce0e72</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Which hardware are you using for this project?&lt;/p&gt;
&lt;p&gt;Just to clarify, are you using the &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK or nRF5 SDK&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>