<?xml-stylesheet type="text/xsl" href="https://community.element14.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>Connect to AVNET iotconnect.io with Node-RED - part 8a: safer connect with Self Signed Certificates</title><link>/technologies/industrial-automation-space/b/blog/posts/connect-to-avnet-iotconnect-io-with-node-red---part-8a-safer-connect-with-self-signed-certificates</link><description>AVNET&amp;#39;s iotconnect.io cloud platform is an online service that you can use to send data to, and then show it on a dashboard. In this blog series I&amp;#39;m learning how to talk to it with Node-RED.In this post: authentication with a Self Signed Certificate.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Connect to AVNET iotconnect.io with Node-RED - part 8a: safer connect with Self Signed Certificates</title><link>https://community.element14.com/technologies/industrial-automation-space/b/blog/posts/connect-to-avnet-iotconnect-io-with-node-red---part-8a-safer-connect-with-self-signed-certificates</link><pubDate>Fri, 09 Apr 2021 21:39:10 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:cf44497e-4ff1-4f68-9f90-3e61bafb4f13</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Initially, I intended to skip self signed certificates, and step directly to CA generated ones.&lt;/p&gt;&lt;p&gt;But I spent a day trying and didn&amp;#39;t get a working connection.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You need 3 sets of artifacts:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;a root CA certificate-key pair&lt;/li&gt;&lt;li&gt;a proof of ownership (validation) certificate generated by that root CA and its private key&lt;/li&gt;&lt;li&gt;a client certificate-key pair, also generated by that root CA and its private key&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m successful with step one and 2.&lt;/p&gt;&lt;p&gt;I can create a root certificate and its key, then upload it to the IoTConnect servers.&lt;/p&gt;&lt;p&gt;This generates a challenge token. You need to generate the validation certificate with the challenge as the certificate&amp;#39;s common name. Then upload that to the server.&lt;/p&gt;&lt;p&gt;If that&amp;#39;s successful, the CA certificate is accepted as a source for client certificates.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As you can see, I&amp;#39;ve been quite busy:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x99/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-cf44497e-4ff1-4f68-9f90-3e61bafb4f13/1731.contentimage_5F00_207914.png:620:99]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Certificate 2 and 3 are trials with OpenSSL on linux.&lt;/p&gt;&lt;p&gt;The first one is generated on Windows - following &lt;a class="jive-link-external-small" href="https://github.com/Azure/azure-iot-sdk-c/blob/master/tools/CACertificates/CACertificateOverview.md" rel="nofollow ugc noopener" target="_blank"&gt;Azure&amp;#39;s instructions&lt;/a&gt; (IoTConnect runs on Azure servers and stack).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Each time the results are the same: the validation certificate is OK. It marks the CA as verified on the server.&lt;/p&gt;&lt;p&gt;(I also did negative tests: un purpose gave wrong info in the verify certificate, to see if the validation is real. It is real).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;But the client can&amp;#39;t connect with the client certificate I generate:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x217/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-cf44497e-4ff1-4f68-9f90-3e61bafb4f13/4863.contentimage_5F00_207915.png:620:217]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;ve entered a support request for IoTConnect support:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;I am able to connect a device with the CPID/Unique ID combination, and with a Self Signed &lt;/em&gt;&lt;span&gt;&lt;em&gt;certificate&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;a class="jive-link-blog-small" href="/technologies/industrial-automation-space/b/blog/posts/connect-to-avnet-iotconnect-io-with-node-red---part-8a-safer-connect-with-self-signed-certificates"&gt;https://www.element14.com/community/community/applications/industrial-automation-space/blog/2021/04/09/connect-to-avnet-iotconnectio-with-node-red-part-8a-safer-connect-with-certificates &lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;I am also able to generate and upload a CA certificate to the portal, then generate a validation certificate and validate the CA successfully. &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;However, when I create a CA template, then a device that uses that template and my verified CA, it fails to connect from Node-RED. &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;symptom: &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Node shows as disconnected. &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Node-RED log: Connection closed ::: DeviceId :: *********************-e14cacert1 :: 2021-04-09T15:19:39.818Z &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;em&gt;I created the client certificate and key in a similar way as the verification certificate I used to proof that I own the CA certificate.&lt;/em&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=21825&amp;AppID=141&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>