<?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/"><channel><title>Enabling and testing TLS in mqtt_simple</title><link>/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><description>The MQ Telemetry Transport (MQTT) protocol is hugely popular in IoT because it is lightweight and versatile. In this post we will enable Transport Layer Security (TLS) in the mqtt_simple sample from the nRF Connect SDK (NCS) and then connect it to a </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><item><title>RE: Enabling and testing TLS in mqtt_simple</title><link>https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><pubDate>Wed, 25 Nov 2020 12:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c442c7-e167-4efa-b47a-b293cf011c88</guid><dc:creator>paul_tanner</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&lt;span&gt;&amp;nbsp;have followed these instructions and got to the point where it says &amp;quot;&lt;/span&gt;&lt;span&gt;At this point the sample should compile but won&amp;#39;t use TLS&amp;quot;.&amp;nbsp; It does compile but does not make a connection.&amp;nbsp; I am building for 9160-DK (ns) on the command line on MacOS.&amp;nbsp; I suspect that the problem may be that I am trying to use the supplied iBasis SIM straight out of the box.&lt;/span&gt;&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1293&amp;AppID=27&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Enabling and testing TLS in mqtt_simple</title><link>https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><pubDate>Wed, 18 Mar 2020 18:22:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c442c7-e167-4efa-b47a-b293cf011c88</guid><dc:creator>m9th</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I added all of the code snippets above to the files indicated. I reloaded the project from the open nfrconnect sdk project. When I look in main.c all of the conditionals for&amp;nbsp;CONFIG_MQTT_LIB_TLS remain grayed out.&amp;nbsp; prj.conf has CONFIG_MQTT_LIB_TLS=y. What am I missing?&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1293&amp;AppID=27&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Enabling and testing TLS in mqtt_simple</title><link>https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><pubDate>Tue, 03 Mar 2020 23:41:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c442c7-e167-4efa-b47a-b293cf011c88</guid><dc:creator>PeterC</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;I have followed these instructions carefully but I am getting the build error:&lt;/p&gt;
&lt;p&gt;&lt;em&gt; &amp;#39;sec_tag_list&amp;#39; undeclared (first use in this function); did you mean &amp;#39;sec_tag_t&amp;#39;?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;from the changes to client_init (error line&amp;nbsp;in bold below):&lt;/p&gt;
&lt;p&gt;&lt;em&gt;#if defined(CONFIG_MQTT_LIB_TLS)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; struct mqtt_sec_config *tls_config = &amp;amp;client-&amp;gt;transport.tls.config;&lt;/em&gt;&lt;br /&gt; &lt;br /&gt;&lt;em&gt; client-&amp;gt;transport.type = MQTT_TRANSPORT_SECURE;&lt;/em&gt;&lt;br /&gt; &lt;br /&gt;&lt;em&gt; tls_config-&amp;gt;peer_verify = CONFIG_PEER_VERIFY;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; tls_config-&amp;gt;cipher_count = 0;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; tls_config-&amp;gt;cipher_list = NULL;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; &lt;strong&gt;tls_config-&amp;gt;sec_tag_count = ARRAY_SIZE(sec_tag_list);&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; tls_config-&amp;gt;sec_tag_list = sec_tag_list;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; tls_config-&amp;gt;hostname = CONFIG_MQTT_BROKER_HOSTNAME;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;#else &lt;/em&gt;&lt;br /&gt;&lt;em&gt;/* MQTT transport configuration */&lt;/em&gt;&lt;br /&gt;&lt;em&gt; client-&amp;gt;transport.type = MQTT_TRANSPORT_NON_SECURE;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;#endif /* defined(CONFIG_MQTT_LIB_TLS) */&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;maybe I have been looking at this too long and its obvious but any help would be appreciated...&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1293&amp;AppID=27&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Enabling and testing TLS in mqtt_simple</title><link>https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><pubDate>Sat, 15 Feb 2020 08:47:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c442c7-e167-4efa-b47a-b293cf011c88</guid><dc:creator>3Rsteven</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;hi nordic&amp;nbsp;&lt;br /&gt;&lt;br /&gt;it have some erro about cred.py,&amp;nbsp;with&amp;nbsp;&lt;span&gt;NRFJPROG DLL: -3 INVALID_PARAMETER&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;quot;&lt;br /&gt;C:\temp\ncs\nrf\samples\nrf9160\mqtt_simple\cred&amp;gt;python cred.py --CA_cert ../build/zephyr/CA.crt --client_cert ../build/zephyr/client.crt --client_private_key ../build/zephyr/client.key --sec_tag 51966 --program_app merged.hex&lt;br /&gt;xxxxxxxxxxxxxxx&lt;br /&gt;error: An error was reported by NRFJPROG DLL: -3 INVALID_PARAMETER.&lt;br /&gt;C:\temp\ncs\nrf\samples\nrf9160\mqtt_simple\cred&amp;gt;nrfjprog.exe -v&lt;br /&gt;nrfjprog version: 9.8.1&lt;br /&gt;JLinkARM.dll version: 6.54c&lt;br /&gt;&amp;quot;&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1293&amp;AppID=27&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Enabling and testing TLS in mqtt_simple</title><link>https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/software-and-protocols/posts/enabling-and-testing-tls-in-mqtt_5f00_simple</link><pubDate>Tue, 04 Feb 2020 14:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1c442c7-e167-4efa-b47a-b293cf011c88</guid><dc:creator>jbrzozoski</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Excellent article!&amp;nbsp; I especially like the trick of the cred.py mini-application to read IMEI and write certificates and application images.&lt;/p&gt;
&lt;p&gt;Heads-up to anyone depending on full TLS validation: it seems that &lt;a href="/f/nordic-q-a/55929/nrf9160-tls_hostname-support"&gt;hostname validation doesn&amp;#39;t work properly&lt;/a&gt; as of right now. It&amp;#39;s a subtle bug that doesn&amp;#39;t complain or fail, but doesn&amp;#39;t actually enable.&amp;nbsp; (i.e. the hostname will never be checked against the cert name)&lt;/p&gt;
&lt;p&gt;The PEER_VERIFY=2 does work on most servers, though, so you can still be sure that the server you&amp;#39;re connecting to is using a cert from the designated CA, which mitigates most of the risk.&lt;/p&gt;&lt;img src="https://devzone.nordicsemi.com/aggbug?PostID=1293&amp;AppID=27&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>