<?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 enable TLS on MQTT client ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33137/how-to-enable-tls-on-mqtt-client</link><description>Hi, all. 
 I&amp;#39;m making a mqtt client with nRF52832. 
 All examples of SDK 14.2 were using PSK secure. 
 But I want more secured connection as like MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA or MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA. 
 
 Q1: How to generate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Apr 2018 13:26:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33137/how-to-enable-tls-on-mqtt-client" /><item><title>RE: How to enable TLS on MQTT client ?</title><link>https://devzone.nordicsemi.com/thread/127850?ContentTypeID=1</link><pubDate>Wed, 11 Apr 2018 13:26:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85b4d7d0-c48c-4ecd-9860-d7736995c52e</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Thanks for sharing!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable TLS on MQTT client ?</title><link>https://devzone.nordicsemi.com/thread/127515?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 02:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aac7da8-a0ac-4f77-aef8-453130f76d12</guid><dc:creator>Mike Yang</dc:creator><description>&lt;p&gt;I found a solution by myself and share it for you guys.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You should use key &amp;amp; certification string as like below. (I screened some of key value)&lt;/p&gt;
&lt;p&gt;static const char private_crt[] = &amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;&lt;br /&gt;&amp;quot;MIICATCCAWoCCQCtv.................................................\n&amp;quot;&lt;br /&gt;&amp;quot;VTETMBEGA1UECAwK&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;cyBQdHkgTHRkMB4XD&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;A1UEBhMCQVUxEzAR&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;IFdpZGdpdHMgUHR5IE&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;2a0+/m8/tPC3hAMQq&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;JQLqrTRvBUUcNQVw&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;iLh0JEJgFR2Ka8JsfG&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;AAOBgQAovS3rWhQV&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;4pY6KXdPOC1nma+6f&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;qIjDaK3oVYb3SX3E81&lt;span&gt;.................................................&lt;/span&gt;\n&amp;quot;&lt;br /&gt;&amp;quot;-----END CERTIFICATE-----\n&amp;quot;;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And length should be set one more than strlen() result.&lt;/p&gt;
&lt;p&gt;In this case strlen() result is 757 but you should set .certificate_len &lt;span&gt;as 758&amp;nbsp;&lt;/span&gt;in nrf_tls_certificate_t structure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>