<?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>Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91700/unusual-socket-errno-122-when-using-nrf91-tls-psk</link><description>Hello, 
 We are using the NRF9160&amp;#39;s built-in TLS client to connect to our server using PSK credentials. Occasionally after sending a request to our server, when we call poll() to do a timed-wait for the response, we get a POLLERR revent. If we ignore</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Nov 2023 15:17:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91700/unusual-socket-errno-122-when-using-nrf91-tls-psk" /><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/455807?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2023 15:17:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e2b6033-f27e-4230-94b5-d32d1b3866bd</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote userid="122854" url="~/f/nordic-q-a/91700/unusual-socket-errno-122-when-using-nrf91-tls-psk/454586"]there is no messages in the column&amp;nbsp;length more then 760 bites.&amp;nbsp;[/quote]
&lt;p&gt;Those are the TCP packets. A TLS fragment can consist of more than one TCP packet. &lt;/p&gt;
&lt;p&gt;In the attached screenshot, you can see that one of the TLS fragments have a length of 3216.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1700061460489v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/454586?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2023 07:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6f4abd0-0b6f-4724-8896-ed116d64527e</guid><dc:creator>Roman Veselskyi</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/didrik-rokhaug"&gt;Didrik Rokhaug&lt;/a&gt;&amp;nbsp;&lt;span&gt;,&lt;br /&gt;&lt;br /&gt;May you please explain how to see in the Wireshark that server send a TLS fragment which is larger then 2 kb?&amp;nbsp;&lt;br /&gt;I looked into this file&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5700.trace_2D00_2022_2D00_09_2D00_06T17_2D00_19_2D00_37.981Z.bin"&gt;5700.trace-2022-09-06T17-19-37.981Z.bin&lt;/a&gt;&amp;nbsp;but there is no messages in the column&amp;nbsp;length more then 760 bites.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/387812?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 07:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb672f59-6905-48d6-bd27-4f5701b3d609</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Just to mention:&lt;/p&gt;
&lt;p&gt;In the meantime there is a alternative extension for the record size defined in&amp;nbsp;RFC 8449.&lt;/p&gt;
&lt;p&gt;&amp;gt; At least last time we looked into it,&lt;/p&gt;
&lt;p&gt;Not sure, when that was, but I&amp;#39;m pretty sure, mbedTLS supports that feature (see MBEDTLS_SSL_MAX_FRAG_LEN_1024). Maybe someone opens an issue at &lt;a href="https://github.com/Mbed-TLS/mbedtls/issues"&gt;Mbed-TLS Issues&lt;/a&gt; to ask for help.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/385540?ContentTypeID=1</link><pubDate>Fri, 09 Sep 2022 13:42:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3245ea44-5af8-4788-a0cf-fdd840172fab</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="matharman"]&lt;p&gt;I do have one followup question / remark: One of my colleagues pointed out that &lt;a href="https://www.rfc-editor.org/rfc/rfc6066#section-4"&gt;RFC 6066&lt;/a&gt; includes an extension to negotiate a &amp;quot;maximum_fragment_length&amp;quot; in the Client Hello.&lt;/p&gt;
&lt;p&gt;Has the modem firmware team considered implementing this extension? 2kb is a tight constraint, and it would be useful to advertise that to servers support the extension.&lt;/p&gt;[/quote]
&lt;p&gt;At least last time we looked into it, it was not yet implemented in mbedTLS, which is the TLS stack used by the modem.&lt;/p&gt;
&lt;p&gt;It is in our backlog though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/385388?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2022 20:57:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21c00102-9f43-4b64-8fe5-2e8b7474f009</guid><dc:creator>matharman</dc:creator><description>&lt;p&gt;Hi Didrik,&lt;/p&gt;
&lt;p&gt;Thanks for your time analyzing the modem trace. Based on your advice, we were able to decrease the maximum TLS record size on the server to work around this constraint.&lt;/p&gt;
&lt;p&gt;I do have one followup question / remark: One of my colleagues pointed out that &lt;a href="https://www.rfc-editor.org/rfc/rfc6066#section-4"&gt;RFC 6066&lt;/a&gt; includes an extension to negotiate a &amp;quot;maximum_fragment_length&amp;quot; in the Client Hello.&lt;/p&gt;
&lt;p&gt;Has the modem firmware team considered implementing this extension? 2kb is a tight constraint, and it would be useful to advertise that to servers support the extension.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unusual socket errno 122 when using NRF91 TLS-PSK</title><link>https://devzone.nordicsemi.com/thread/384970?ContentTypeID=1</link><pubDate>Wed, 07 Sep 2022 09:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54134b3e-c64d-4c2e-9eb9-de9cd399f2e5</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The modem trace shows that the server sends a TLS fragment that is larger than what the modem is able to store in its internal buffers (and thereby decode).&lt;/p&gt;
&lt;p&gt;This is what causes the connection to be closed, and EMSGSIZE to be returned.&lt;/p&gt;
&lt;p&gt;For TLS, the fragments can be max 2kB, while for DTLS the limit is 1kB.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>