<?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>cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65460/cloud_connect-stuck-in-22nd-connection-attempts-using-aws_iot-backend</link><description>Hello, 
 I am on nrf-sdk v1.3.0 and mwf v1.2.0. 
 We are updating our product to the above mentioned nrf-sfk version and have noticed that MQTT connection gets stuck after 21 successful connections. I have produced a minimal example of the issue that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Sep 2020 07:18:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65460/cloud_connect-stuck-in-22nd-connection-attempts-using-aws_iot-backend" /><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/268408?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2020 07:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4754e61d-e340-470d-9979-ad2500f60ca1</guid><dc:creator>Tjaz</dc:creator><description>&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;I have found it easiest to just comment out lines 72-79 in the file you have linked:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c#L73"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c#L73&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have then verified this fix to be correct over the weekend.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c#L73"&gt;&lt;br /&gt;&lt;/a&gt;For anyone who might need it, I am attaching a git patch file that does this for you. It can then easily be reverted after the fix is introduced in mfw v1.2.1.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/mqtt_5F00_tsl_5F00_hostname_5F00_verification_5F00_disable.patch"&gt;devzone.nordicsemi.com/.../mqtt_5F00_tsl_5F00_hostname_5F00_verification_5F00_disable.patch&lt;/a&gt;&lt;br /&gt;To apply the patch, cd to your zephyr folder and use:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;git apply mqtt_tsl_hostname_verification_disable.patch

# to revert
git apply -R mqtt_tsl_hostname_verification_disable.patch&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Tjaž Vračko&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267810?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 11:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c73eb95e-234a-4215-a99d-d6e9ac65c9a4</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;You are correct, my mistake sorry.&lt;br /&gt;You can instead change it directly in the function instead. (set it directly to avoid the TLS Hostname Verification)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267770?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 08:40:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52cd3ba4-7a4c-4356-9095-1a110608bcb0</guid><dc:creator>Tjaz</dc:creator><description>&lt;p&gt;Thank you for the quick reply, but CONFIG_TLS_HOSTNAME does not seem to exist.&lt;br /&gt;I get this when building:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/workdir/ncs/firmware/prj.conf:83: warning: attempt to assign the value &amp;#39;0&amp;#39; to the undefined symbol TLS_HOSTNAME

error: Aborting due to Kconfig warnings
&lt;/pre&gt;I also can not find it in the Kconfig reference/documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/kconfig/search.html?q=CONFIG_TLS_HOSTNAME&amp;amp;check_keywords=yes&amp;amp;area=default"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/kconfig/search.html?q=CONFIG_TLS_HOSTNAME&amp;amp;check_keywords=yes&amp;amp;area=default#&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267765?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 08:20:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8deab1de-e638-47f8-a66d-b33235cbf9d7</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Tjaž,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Correct, It will be a minor release so there is possible to do a modem FOTA.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Easiest way to disable TLS host verification is to set&amp;nbsp;&lt;br /&gt;CONFIG_TLS_HOSTNAME=0 in prj.conf.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is the function&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c#L73"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/master/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c#L73&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;also, I recommend that you disable the AT host library if you do not need it when testing:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_AT_HOST_LIBRARY&lt;/span&gt;&lt;span&gt;=n&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;(should be used just when testing, not recommended for the final application)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Martin L.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267755?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2020 07:57:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c2f51ee-a1fb-469b-8db8-215262409db1</guid><dc:creator>Tjaz</dc:creator><description>&lt;p&gt;Simply setting &lt;em&gt;CONFIG_MQTT_LIB_TLS=n&lt;/em&gt; in prj.conf does not work, since&amp;nbsp;it is selected by AWS_IOT.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: MQTT_LIB_TLS (defined at subsys/net/lib/mqtt/Kconfig:28) was assigned the value &amp;#39;n&amp;#39; but got
the value &amp;#39;y&amp;#39;. See http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_MQTT_LIB_TLS.html
and/or look up MQTT_LIB_TLS in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;as seen in the docs here:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/kconfig/CONFIG_MQTT_LIB_TLS.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/kconfig/CONFIG_MQTT_LIB_TLS.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How can I then disable this?&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Tjaž&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267671?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 14:37:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5955ecf-83c7-4317-8389-761589ae6bd9</guid><dc:creator>Tjaz</dc:creator><description>&lt;p&gt;Will this be a minor (v1.2.1) release or a major release?&lt;br /&gt;This is important since it is only possible to FOTA upgrade minor releases.&lt;/p&gt;
&lt;p&gt;The workaround is thus to disable &lt;em&gt;TLS hostname verification.&amp;nbsp;&lt;/em&gt;How might we go about doing that?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Tjaž&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: cloud_connect() stuck in 22nd connection attempts (using AWS_IOT backend)</title><link>https://devzone.nordicsemi.com/thread/267656?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2020 14:03:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe874edb-aaec-4b92-929e-3dbf547b960e</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Tjaz,&lt;/p&gt;
&lt;p&gt;The next modem firmware should have this fixed (releases in the near future), but you can try to use &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/61718/not-able-to-publish-more-than-22-mqtt-messages-in-one-shot-mode-with-nrf9160/263974#263974" rel="noopener noreferrer" target="_blank"&gt;the workaround mentioned here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For more information about release schedule please contact your RSM. If you do not know who that is please send me a direct message on Devzone and I will provide the information.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>