<?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>Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57107/provision-certificates-from-the-certificates-h-is-not-setting-the-define</link><description>I have just switched from SDK version 1.0.0 to SDK 1.1.0 and I am using the MQTT FOTA example 
 I had the example project working when I was using v1.0.0 of the SDK 
 
 I have checked &amp;quot;Provision certificates from the certificates.h file&amp;quot; and clicked the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Feb 2020 14:15:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57107/provision-certificates-from-the-certificates-h-is-not-setting-the-define" /><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235488?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2020 14:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c76aaf0-0743-4024-9f9d-e2399aa54774</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;So if I understand you correctly, you have a certificates.h file that looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// file: certificates.h

#define CERT_A \
&amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;\
&amp;quot;aaaaaaaaaaaaaaaaaaaaaaaaaaa\n&amp;quot;\
&amp;quot;-----End CERTIFICATE-----\n&amp;quot;

#define CERT_B \
&amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;\
&amp;quot;bbbbbbbbbbbbbbbbbbbbbbbbbbb\n&amp;quot;\
&amp;quot;-----End CERTIFICATE-----\n&amp;quot;

#define CERT_C \
&amp;quot;-----BEGIN CERTIFICATE-----\n&amp;quot;\
&amp;quot;cccccccccccccccccccccccccccc\n&amp;quot;\
&amp;quot;-----End CERTIFICATE-----\n&amp;quot;

#define CERT_TO_BE_USED CERT_A
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And then you write CERT_TO_BE_USED to the modem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235293?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 22:08:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbfed2c2-d2df-44f5-8a03-d3fd6f2deb23</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;I have a conditional compile in certificates.h that allows me to pick from 3 different certificate sets that I created for AWS things. If I build the project with the original certificate set of the 3 then the device connects to AWS IoT. But I need to support different certificate sets for each device that will be deployed&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582150076306v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235289?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 21:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58b0fa3f-8f40-4060-9ee9-e104c4d642a5</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;This is what I found for searching the source code for CLOUD_CERT_SEC_TAG&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582147653663v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And this is what I found in the nrf Connect Project Settings&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582147821777v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235183?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 12:44:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fa21fa1-f5b5-4440-ae7b-ed7a66011c23</guid><dc:creator>Didrik Rokhaug</dc:creator><description>[quote user="hmichel"] I see the delete inbuilt keys have a result code of zero. Is that ok?[/quote]
&lt;p&gt;&amp;nbsp;Yes, that means that it was successfully able to delete the certificates.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="hmichel"]When I try to use new certificates from AWS in certificates.h I get a -45 error when I try to connect to AWS. So it seems that the default certificates are not getting overwritten at run time.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;What sec_tag are you providing to the socket?&lt;/p&gt;
&lt;p&gt;And is that sec_tag dependent on some configuration options?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235165?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 12:02:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:523e1eb6-1005-4015-b158-fa3b3b2a3c52</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;Also here is the Terminal trace window from startup. I see the delete inbuilt keys have a result code of zero. Is that ok?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582113732894v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235162?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 11:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cfd6dca-d274-4c27-9e04-5a45756832bd</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;Just confirmed that Modem firmware version is 1.1.1 by running &lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;%SHORTSWVER&lt;/span&gt; command&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1582113480979v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/235158?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2020 11:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d86f4149-98b0-418c-9453-9e30455a25e5</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;Actually this is still an issue and now it is of much higher priority.&lt;/p&gt;
&lt;p&gt;It seems as though my board is using the certificates that I had to set using the AT Client software and my certificates that had been converted to JSON format a few months ago. Follow this thread and you will see where Martin had sent me a file containing my certificates converted to JSON format&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;a href="https://devzone.nordicsemi.com/support/233736"&gt;https://devzone.nordicsemi.com/support/233736&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;I believe that I have the latest Modem firmware in my board.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When I try to use new certificates from AWS in certificates.h I get a -45 error when I try to connect to AWS. So it seems that the default certificates are not getting overwritten at run time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/231793?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 08:11:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:802eaaa2-affc-4fef-a9dc-aff103d2eef1</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;The issue has been reported internally, and we&amp;#39;ll bring this up with Segger.&lt;/p&gt;
&lt;p&gt;As you say, the problem is only with Embedded Studio not detecting the configuration. Your application will work as expected.&lt;/p&gt;
&lt;p&gt;&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><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/231774?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 02:21:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fe309f2-7112-40cc-91ef-6e89c51b8187</guid><dc:creator>hmichel</dc:creator><description>&lt;p&gt;certificates.h file is It is still grayed out&lt;/p&gt;
&lt;p&gt;I did a rebuild (which should do a clean and build) still no change&lt;/p&gt;
&lt;p&gt;However, when I put random text inside the ifdef then I get a compile error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So it is just a type of display problem and not actually leaving out the certificates.h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Provision certificates from the certificates.h is not setting the #define</title><link>https://devzone.nordicsemi.com/thread/231678?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 14:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d553a4f-da2f-4ebf-a365-24e15ec0255a</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;&lt;p&gt;I notice that the name of the define in the menu settings is &amp;lt;PROVISION_CERTIFICATES&amp;gt;&lt;/p&gt;&lt;p&gt;and in the code on line 28 it is CONFIG_PROVISION_CERTIFICATES&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Yes, this is correct. A Kconfig option will generate the #define CONFIG_&amp;lt;name of option&amp;gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;&lt;p&gt;I have checked &amp;quot;Provision certificates from the certificates.h file&amp;quot; and clicked the configure button&lt;/p&gt;&lt;p&gt;but in main.c the define at line 28 has not been set so the certificates .h file is not included.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;What do you mean by that. Did it not change color?&lt;/p&gt;
&lt;p&gt;Did you build the project again after applying the settings?&lt;/p&gt;
&lt;p&gt;Or did you empty the build directory?&lt;/p&gt;
&lt;p&gt;If you place a #error inside the #ifdef, does it still compile?&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>