<?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 — disable cert validity checks]]></title>
		<link>https://www.wolfssl.com/forums/topic814-disable-cert-validity-checks.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic814.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in disable cert validity checks.]]></description>
		<lastBuildDate>Thu, 02 Jun 2022 20:39:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post6574.html#p6574</link>
			<description><![CDATA[<p>You can disable wolfSSL&#039;s certificate validity check using wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);<br />This significantly hurts security, and we strongly recommend against it.&nbsp; Instead, you should register your CA certificates by calling wolfSSL_CTX_load_verify_locations(ctx, NULL, &quot;/path/to/CAcerts/&quot;); before connecting.</p><p>Thanks,<br />Kareem</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Thu, 02 Jun 2022 20:39:16 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6574.html#p6574</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post6571.html#p6571</link>
			<description><![CDATA[<p>Hi,</p><p>I am having a similar issue, I just wanted to use wolfssl without certification(ctx). Is it possible ???<br />I want Wolfssl for connecting, sending and receiving purposes</p>]]></description>
			<author><![CDATA[null@example.com (munib.ahmed)]]></author>
			<pubDate>Thu, 02 Jun 2022 02:42:47 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6571.html#p6571</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2606.html#p2606</link>
			<description><![CDATA[<p>Thanks for the reply. Is there any way to override this behavior?</p><p>This doesn&#039;t quite make sense to me. Isn&#039;t the certificate chain updated during the handshake? Would this callback be able to override data errors there??</p><p>Also, what about OCSP checks? Does this callback override those, or does it not?</p><p>I did a test where I added a date override callback, rolled back my clock, and tried to connect.</p><p>About to verify certificate signature<br />No CA signer to verify with<br />Failed to verify Peer&#039;s cert<br />&nbsp; &nbsp; Callback override available, will continue<br />wolfSSL Entering InitOcspRequest<br />----------- date_override_cb -------------<br />wolfSSL Entering ERR_error_string<br />In verification callback, error = -188, ASN no signer error to confirm failure<br />Subject&#039;s domain name is officeapps.live.com<br />Cert error is not date error, not overriding<br />growing output buffer</p><br /><p>Now, I know for a fact that I have the right CA cert loaded up, coz when I pull the clock to real time, this works. Looks like the error reporting here is incorrect. I looked at the code, there is indeed, a call to ParseCertRelative, which does a date check...</p><p>So it seems like this override callback is not really doing what it claims, or I am doing something wrong. Not sure which is the case.</p>]]></description>
			<author><![CDATA[null@example.com (earlenceferns)]]></author>
			<pubDate>Tue, 12 Jul 2016 23:00:39 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2606.html#p2606</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2604.html#p2604</link>
			<description><![CDATA[<p>Hi earlenceferns,</p><p>Thanks for sending over your debug log.&nbsp; That helps clarify things for me.</p><p>wolfSSL doesn&#039;t currently call the verify callback during CA certificate processing in wolfSSL_CTX_load_verify_locations().&nbsp; We try to process the certificate chain, then just return an error if the any of them failed to verify/load.&nbsp; The verify callback does get called during the SSL/TLS connection when the client/server is authenticating and verifying the peer certificate.</p><p>Reasoning for not including the verify callback in wolfSSL_CTX_load_verify_locations() is simply to avoid potential security problems and application vulnerabilities where the CA certificate verification can be skipped/overridden.</p><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 12 Jul 2016 22:53:02 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2604.html#p2604</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2597.html#p2597</link>
			<description><![CDATA[<p>wolfSSL Entering WOLFSSL_CTX_new<br />wolfSSL Entering wolfSSL_CertManagerNew<br />wolfSSL Leaving WOLFSSL_CTX_new, return 0<br />wolfSSL Entering wolfSSL_CTX_set_verify<br />wolfSSL Entering wolfSSL_CTX_load_verify_locations<br />Getting dynamic buffer<br />Processing CA PEM file<br />wolfSSL Entering PemToDer<br />Adding a CA<br />wolfSSL Entering GetExplicitVersion<br />wolfSSL Entering GetMyVersion<br />Got Cert Header<br />wolfSSL Entering GetAlgoId<br />wolfSSL Entering GetObjectId()<br />Got Algo ID<br />Getting Cert Name<br />Getting Cert Name<br />Got Subject Name<br />wolfSSL Entering GetAlgoId<br />wolfSSL Entering GetObjectId()<br />Got Key<br />Parsed Past Key<br />wolfSSL Entering DecodeCertExtensions<br />wolfSSL Entering GetObjectId()<br />wolfSSL Entering DecodeKeyUsage<br />wolfSSL Entering GetObjectId()<br />wolfSSL Entering DecodeBasicCaConstraint<br />wolfSSL Entering GetObjectId()<br />wolfSSL Entering DecodeSubjKeyId<br />wolfSSL Entering GetObjectId()<br />wolfSSL Entering DecodeAuthKeyId<br />wolfSSL Entering GetAlgoId<br />wolfSSL Entering GetObjectId()<br />&nbsp; &nbsp; Parsed new CA<br />&nbsp; &nbsp; Freeing Parsed CA<br />&nbsp; &nbsp; Freeing der CA<br />&nbsp; &nbsp; &nbsp; &nbsp; OK Freeing der CA<br />wolfSSL Leaving AddCA, return -150<br />wolfSSL error occurred, error = -150<br />CA Parse failed, with progress in file.<br />Search for other certs in file<br />wolfSSL Entering ERR_error_string<br />error loading up CA cert: ASN date error, current date before<br />wolfSSL Entering SSL_CTX_free<br />CTX ref count down to 0, doing full free<br />wolfSSL Entering wolfSSL_CertManagerFree<br />wolfSSL Leaving SSL_CTX_free, return 0<br />wolfSSL Entering wolfSSL_Cleanup</p>]]></description>
			<author><![CDATA[null@example.com (earlenceferns)]]></author>
			<pubDate>Tue, 12 Jul 2016 21:28:56 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2597.html#p2597</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2595.html#p2595</link>
			<description><![CDATA[<p>OK. Doing it now. I&#039;ll post back in a couple minutes!</p>]]></description>
			<author><![CDATA[null@example.com (earlenceferns)]]></author>
			<pubDate>Tue, 12 Jul 2016 21:11:41 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2595.html#p2595</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2592.html#p2592</link>
			<description><![CDATA[<p>Hi,</p><p>Can you send me the output of your wolfSSL debug log for the case you think is odd/incorrect?&nbsp; wolfSSL debugging can be enabled by compiling wolfSSL with <strong>DEBUG_WOLFSSL</strong>, then calling wolfSSL_Debugging_ON() as the first wolfSSL function call in your application code.</p><p>Thanks,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 12 Jul 2016 20:58:46 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2592.html#p2592</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2583.html#p2583</link>
			<description><![CDATA[<p>Thanks for the reply. I tried this code, but I&#039;ve noticed very strange behavior.</p><p>I&#039;ve placed a call to wolfSSL_CTX_set_verify right before I do a wolfSSL_CTX_load_verify_locations. My VerifyCallback is the same code as the myDateCb.</p><p>Then I set the clock on my system to the start of the epoch (Jan 1, 1970) and then I run my code. I get an error message saying ASN date error, current date before. I also see that my VerifyCallback is not even called (I simply have a printf printing whenever it is called)</p><p>When I set my clock to correct date and time, I do see that the VerifyCallback is getting called. Why this strange behavior?</p><div class="codebox"><pre><code>    wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, date_override_cb);

    //Load up CA certs
    if ((err = wolfSSL_CTX_load_verify_locations(ctx, NULL, capath)) != SSL_SUCCESS) {
      logsslerror(err, &quot;error loading up CA cert&quot;);
    }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (earlenceferns)]]></author>
			<pubDate>Thu, 07 Jul 2016 23:44:19 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2583.html#p2583</guid>
		</item>
		<item>
			<title><![CDATA[Re: disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2564.html#p2564</link>
			<description><![CDATA[<p>Hi,</p><p>By default wolfSSL does all certificate verification internally.&nbsp; The user can inspect and do custom verification using the wolfSSL verify callback.&nbsp; The callback can be registered by passing it as the third argument to the wolfSSL_CTX_set_verify() function.&nbsp; Ex:</p><div class="codebox"><pre><code>void wolfSSL_CTX_set_verify(WOLFSSL_CTX* ctx, int mode, VerifyCallback vc);
typedef int (*VerifyCallback)(int preverify, WOLFSSL_X509_STORE_CTX* store);</code></pre></div><p>Normally, the verify callback is only called upon verification failure.&nbsp; If you define <strong>WOLFSSL_ALWAYS_VERIFY_CB</strong>, the callback will always be called.&nbsp; In this case, if &quot;preverify&quot; is equal to &quot;1&quot;, wolfSSL has already successfully verified the peer certificate.&nbsp; We provide this option for those users who wish to do custom inspection of certificate elements past normal certificate verification measures.</p><p>We have an example verify callback that overrides date errors.&nbsp; It is called &quot;myDateCb()&quot;, located in &lt;wolfssl/test.h&gt;.</p><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Mon, 27 Jun 2016 23:11:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2564.html#p2564</guid>
		</item>
		<item>
			<title><![CDATA[disable cert validity checks]]></title>
			<link>https://www.wolfssl.com/forums/post2563.html#p2563</link>
			<description><![CDATA[<p>I only want to disable the date/time checking in cert validation (server cert, ocsp certs etc). Is this possible? I don&#039;t want to disable it in general for the library, but only for a particular client using the library. Is there some API I can call to do this? Or some combination of APIs?</p>]]></description>
			<author><![CDATA[null@example.com (earlenceferns)]]></author>
			<pubDate>Sun, 26 Jun 2016 05:36:03 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2563.html#p2563</guid>
		</item>
	</channel>
</rss>
