<?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 — ESP32-Arduino MQTT Lock up]]></title>
		<link>https://www.wolfssl.com/forums/topic1527-esp32arduino-mqtt-lock-up.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1527.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in ESP32-Arduino MQTT Lock up.]]></description>
		<lastBuildDate>Mon, 30 Mar 2020 13:46:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: ESP32-Arduino MQTT Lock up]]></title>
			<link>https://www.wolfssl.com/forums/post5180.html#p5180</link>
			<description><![CDATA[<p>Hi rvogel,</p><p>Your code looks correct for loading a trusted CA. I would suggest its not locking up, but instead is taking a long time. Internally its doing an asymmetric verify operation. Are you able to see with a debugger where its &quot;locking up&quot;. Have you confirmed you have enough stack/heap available? Is this an ECC or RSA certificate? Have you tried enabling debug logging? To do so define DEBUG_WOLFSSL and call wolfSSL_Debugging_ON();. If you want to redirect to printf instead of the default sprintf(stderr define `WOLFSSL_LOG_PRINTF`.</p><p>Thanks,<br />David Garske, wolfSSL</p>]]></description>
			<author><![CDATA[null@example.com (dgarske)]]></author>
			<pubDate>Mon, 30 Mar 2020 13:46:04 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5180.html#p5180</guid>
		</item>
		<item>
			<title><![CDATA[ESP32-Arduino MQTT Lock up]]></title>
			<link>https://www.wolfssl.com/forums/post5177.html#p5177</link>
			<description><![CDATA[<p>I have installed wolfSSL and wolfMQTT for the Arduino IDE. I&#039;ve reworked the wolfMQTT example code for WiFi instead of Ethernet since I&#039;m using an ESP32 dev board. </p><p>I have a cert that is already being used in a non-wolfSSL implementation and connects to a mosquitto broker. The cert is loaded into the code as:<br /></p><div class="codebox"><pre><code>const char* ca_cert = \
                      &quot;-----BEGIN CERTIFICATE-----\n&quot; \
                     --------cert code here-------------
                      &quot;-----END CERTIFICATE-----\n&quot;;</code></pre></div><p>How would I load the cert? This is what I&#039;m trying and it locks up:</p><div class="codebox"><pre><code>static int mqttclient_tls_cb(MqttClient* cli)
{
  int rc = WOLFSSL_FAILURE;

  cli-&gt;tls.ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
  
  if (cli-&gt;tls.ctx) {
    wolfSSL_CTX_set_verify(cli-&gt;tls.ctx, SSL_VERIFY_NONE, mqttclient_tls_verify_cb);

    /* default to success */
    rc = WOLFSSL_SUCCESS;

    /* Load CA certificate buffer */[b]&lt;----************This is where it locks up!!**************[/b]
    rc = wolfSSL_CTX_load_verify_buffer(cli-&gt;tls.ctx,
                                        (const byte*)ca_cert, (long)XSTRLEN(ca_cert), WOLFSSL_FILETYPE_PEM);
  }

  PRINTF(&quot;MQTT TLS Setup (%d)&quot;, rc);

  return rc;
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (rvogel)]]></author>
			<pubDate>Mon, 30 Mar 2020 04:17:50 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post5177.html#p5177</guid>
		</item>
	</channel>
</rss>
