<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Error -150 results in a BACKWARDS issue]]></title>
		<link>https://www.wolfssl.com/forums/topic2087-error-150-results-in-a-backwards-issue.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2087.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Error -150 results in a BACKWARDS issue.]]></description>
		<lastBuildDate>Tue, 20 Feb 2024 19:53:37 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Error -150 results in a BACKWARDS issue]]></title>
			<link>https://www.wolfssl.com/forums/post7515.html#p7515</link>
			<description><![CDATA[<p>So, I have this solved for my silicon, and I&#039;m posting it here for anyone else who runs into this.</p><p>Going down the list:<br /></p><ul><li><p>NTP isn&#039;t an option.</p></li><li><p>Using WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY allows the CA to load, but the verify still gives an error -150 because the time is still outside the Certificate window.</p></li><li><p>Overriding the verify until the server tells the device what time it is opens up to allowing anything to validate, because the CA won&#039;t load, unless the above step is also done.</p></li><li><p>Setting NO_ASN_TIME_CHECK opens it up for all time, since it&#039;s a build setting</p></li></ul><p>The time functions used by this build of WolfSSL are mapped from &quot;time()&quot;, which is the &quot;Unix&quot; function.&nbsp; To set that, the C function clock_settime() is supposed to be used.</p><p>In the environment I am using, it is TI SYSBIOS on Sitara chip <em>(which TI has completely walked away from any support including baremetal...&nbsp; &quot;Sucks to be you&quot; is their attitude)</em>, the clock_settime() library is not present. The header is there, but no lib to link to.</p><p>Also the Unix C function &quot;time()&quot; doesn&#039;t get or set by the RTC functions that their SYSBIOS/RTOS/XDC API environment has. Nor does setting the Unix time do anything to the RTC registers.&nbsp; So the RTC registers in the CPU are never in line with the Unix time.&nbsp; The RTC registers power up as 01 Jan 2000, while the Unix time() is still 01 Jan 1970. </p><p>I don&#039;t know what is incrementing the Unix time, since it&#039;s not coupled to the RTC registers or to any timer interrupt I am aware of.</p><p>Regardless,&nbsp; I discovered that I can set the Unix time with Seconds_set(now) which is a SYSBIOS/XDC function, where &quot;now&quot; is a time_t value.&nbsp; Although it still remains different from the RTC registers that the CPU uses.&nbsp; </p><p>Then when the Wolf library calls time(), it gets the value I injected into it.&nbsp; So I can forcibly set it to a value which is within the CA validity window and it loads.&nbsp; And it can also make the first connection to the server and not have any issue with the certificate time either.&nbsp; </p><p>Then the server tells the device what time it <span class="bbu">really</span> is, so I can set both the RTC registers as well as the Unix time, and everyone is happy.</p><p>-Scotty</p>]]></description>
			<author><![CDATA[null@example.com (Scotty2541)]]></author>
			<pubDate>Tue, 20 Feb 2024 19:53:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7515.html#p7515</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error -150 results in a BACKWARDS issue]]></title>
			<link>https://www.wolfssl.com/forums/post7513.html#p7513</link>
			<description><![CDATA[<p>Hi Scotty</p><p>There are a couple of ways to resolve this. You could <br /></p><ul><li><p>Use NTP to set the time prior to connecting to the server.</p></li><li><p>Disable time verification during runtime by loading certs using _ex version of load API with WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY flag</p></li><li><p>Use a verify callback to override the date errors during the first server connection.</p></li><li><p>Configure no date checks ever - define NO_ASN_TIME_CHECK</p></li></ul><p>Let us know if that helps.</p><p>Thanks,<br />Eric - wolfSSL Support</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Mon, 19 Feb 2024 16:36:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7513.html#p7513</guid>
		</item>
		<item>
			<title><![CDATA[Error -150 results in a BACKWARDS issue]]></title>
			<link>https://www.wolfssl.com/forums/post7512.html#p7512</link>
			<description><![CDATA[<p>I am getting an error -150 when attempting to call &quot;wolfSSL_CTX_load_verify_buffer()&quot;</p><p>But only in my embedded project.&nbsp; Not on my PC.</p><p>The issue:&nbsp; &nbsp;The SERVER tells the unit what the time is. There is no battery backed RTC.&nbsp; &nbsp;<br />We can&#039;t get to the server to tell us the time because the CAs cannot be loaded.</p><p>The CAs I am testing are from DigiCert<br />&nbsp; &nbsp; &nbsp; &nbsp;Validity<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp; Not Before: Mar 30 00:00:00 2021 GMT</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Not After : Mar 29 23:59:59 2031 GMT<br />&nbsp; &nbsp; &nbsp; &nbsp; Validity<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong> Not Before: Aug&nbsp; 1 12:00:00 2013 GMT</strong><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Not After : Jan 15 12:00:00 2038 GMT</p><p>I tried setting our internal clock to 2022 01 01 00 00 00 001&nbsp; (Jan1 2022) BEFORE even calling </p><div class="codebox"><pre><code>m_sslCtx = wolfSSL_CTX_new(meth);</code></pre></div><p>But it is still failing to load the CAs.</p><p>And to verify it is set, I display the time immediately AFTER calling </p><div class="codebox"><pre><code>wolfSSL_CTX_load_verify_buffer()  </code></pre></div><p>and getting a failure.</p><p>So, how/where is the Wolf lib getting the time that it decides to reject the CA&#039;s?</p><p>How can I force it to load the CA file before the time is set?</p>]]></description>
			<author><![CDATA[null@example.com (Scotty2541)]]></author>
			<pubDate>Mon, 19 Feb 2024 16:23:34 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7512.html#p7512</guid>
		</item>
	</channel>
</rss>
