<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="219935" data-post-id="219935">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I understand your points.<br>
Sure not a bad thing for the community to have a wrapper of emqtt.<br>
Still I’d rather use emqtt directly before pulling in a dependency.</p>
<p>The code I posted is just the first step, but it will surely be way less than 500loc.</p>
<aside class="quote no-group" data-username="brianmay" data-post="11" data-topic="41028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/48/19386_2.png" class="avatar"> brianmay:</div>
<blockquote>
<p>I wonder if emqtt supports IPv6?</p>
</blockquote>
</aside>
<p>It’s not directly used in <code>:gen_udp.connect</code> options (see: <a href="https://github.com/emqx/emqtt/blob/321a67665111f81ddc124878b1168b635b827b27/src/emqtt_sock.erl#L46" rel="noopener nofollow ugc">emqtt_sock.erl</a>)  but you can try to override the default configuration:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://www.erlang.org/doc/apps/erts/inet_cfg.html">
  <header class="source">

      <a href="https://www.erlang.org/doc/apps/erts/inet_cfg.html" target="_blank" rel="noopener nofollow">erlang.org</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://www.erlang.org/doc/apps/erts/inet_cfg.html" target="_blank" rel="noopener nofollow">Inet Configuration — OTP 29.0.2 (erts 17.0.2)</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>(never done this)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219935" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-219935" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219935"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="220000" data-post-id="220000">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The next step will be to try to get this working in Github CI. This is going to be a bit useless if it breaks all my CI tests <img src="https://forum.elixirforum.com/images/emoji/apple/frowning.png?v=15" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"></p>
<p>On the topic of IPv6, looks like I need to set:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">tcp_opts: [
    :inet6
],
</code></pre>
<p>Which is one of the opts supported by emqtt. It annoys me that this isn’t the default in erlang - it should be the default to try IPv6 then IPv4 - but I guess we are stuck with legacy code and the need to provide a stable API.</p>
<p>I might as well describe my TLS solution. I need to set:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">      ssl_opts: [
        server_name_indication: 'hostname.example.org',
        verify: :verify_peer,
        cacertfile: mqtt_ca_cert_file
      ],
</code></pre>
<p>If I don’t set the <code>server_name_indication</code> to the hostname (must be a charlist!), the hostname verification of the certificate fails. The documentation seems to indicate that this should default to the hostname supplied to the connect call - <a href="https://erlang.org/doc/man/ssl.html#type-sni" class="inline-onebox" rel="nofollow">ssl — OTP 29.0.2 (ssl 11.7.2)</a> - which I thought meant it should be OK if I don’t supply it. But after using the debugger on the code (and only vaguely understanding it) I strongly suspect the supplied hostname is the IP address, which - as per the documentation (and common sense!) won’t work.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220000" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-220000" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220000"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="220010" data-post-id="220010">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="kaashyapan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kaashyapan/120/9827_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  kaashyapan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh there is definitely demand for an elixir MQTT client.<br>
I tried several days to get a solution that connects to AWS IOT.</p>
<p>I tried tortoise and the erlang one.<br>
The problem was always SSL on the beam. Never managed to get it working.<br>
But this was in OTP 20 and there were some problems in SSL/crypto around that release I think.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220010" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-220010" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220010"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="220011" data-post-id="220011">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="brianmay" data-post="8" data-topic="41028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/48/19386_2.png" class="avatar"> brianmay:</div>
<blockquote>
<pre data-code-wrap="elixir"><code class="lang-elixir">[ 83%] Building C object CMakeFiles/quicer_static.dir/c_src/quicer_listener.c.o
cc1: error: too many filenames given.  Type cc1 --help for usage
cc1: error: too many filenames given.  Type cc1 --help for usage
cc1: fatal error: CMakeFiles/quicer_static.dir/c_src/quicer_queue.c.d: No such file or directory
compilation terminated.
</code></pre>
</blockquote>
</aside>
<p>Any ideas of the build failures? What seems weird is that it starts off compiling files fine. Then it gets to a point where it won’t compile the file even when repeatedly re-tried.</p>
<p>Tried a number of things, all of them failed. Running out of ideas.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220011" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-220011" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220011"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="220022" data-post-id="220022">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just noticed somebody opened a bug report. Hmmm. Wonder if this was in response to this post…</p>
<p><a href="https://github.com/emqx/quic/issues/46" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/emqx/quic/issues/46</a></p>
<p>Will see if I can add details.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220022" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-220022" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220022"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="220023" data-post-id="220023">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Sebb" data-post="5" data-topic="41028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sebb/48/21818_2.png" class="avatar"> Sebb:</div>
<blockquote>
<p>latest - 1.4.0 - seems to be out of sync with the docs in readme</p>
</blockquote>
</aside>
<p>Hmmm. Eventually I probably will want to try the latest version. But I don’t see anything like a changelog documenting breaking changes.</p>
<p>Any ideas what changes I will need to make?</p>
<p>LATER: on second thoughts the changes don’t look particularly significant:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://github.com/emqx/emqtt/compare/v1.2.4...1.4.2">
  <header class="source">
      <img src="https://github.githubassets.com/favicons/favicon.svg" class="site-icon" alt="" width="32" height="32">

      <a href="https://github.com/emqx/emqtt/compare/v1.2.4...1.4.2" target="_blank" rel="noopener nofollow ugc">GitHub</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/344;"><img src="https://opengraph.githubassets.com/62f4063f010c7f06c98012dedab90ca69e48038c3a6909c8c8c7716402e1ae36/emqx/emqtt" class="thumbnail" alt="" width="690" height="345"></div>

<h3><a href="https://github.com/emqx/emqtt/compare/v1.2.4...1.4.2" target="_blank" rel="noopener nofollow ugc">Comparing v1.2.4...1.4.2 · emqx/emqtt</a></h3>

  <p>Erlang MQTT 5.0 Client. Contribute to emqx/emqtt development by creating an account on GitHub.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220023" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-220023" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220023"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="220034" data-post-id="220034">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="brianmay" data-post="17" data-topic="41028">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/48/19386_2.png" class="avatar"> brianmay:</div>
<blockquote>
<p>I don’t see anything like a changelog documenting breaking changes.</p>
</blockquote>
</aside>
<p>I just tried my code with</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{:emqtt, github: "emqx/emqtt", tag: "1.4.2"},
</code></pre>
<p>and it works. I took no notes (bad) so I don’t know what the problem was.</p>
<p>About your build problems: works for me, so it must work in Github Actions (when you use the same toolchain, check all versions.).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220034" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-220034" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220034"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="220035" data-post-id="220035">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="brianmay" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/brianmay/120/19386_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  brianmay
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Latest theory is that it might be related to the cmake version version. Downgrading to an earlier cmake seems to fix it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220035" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-220035" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220035"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="220052" data-post-id="220052">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Seems like the challenges are</p>
<ul>
<li>IPv6</li>
<li>different encryption and authentication methods</li>
</ul>
<p>mosquitto has multiple servers running at <a href="http://test.mosquitto.org" rel="noopener nofollow ugc">test.mosquitto.org</a> providing these methods:</p>
<blockquote>
<p>The server listens on the following ports:</p>
<p>1883 : MQTT, unencrypted, unauthenticated<br>
1884 : MQTT, unencrypted, authenticated<br>
8883 : MQTT, encrypted, unauthenticated<br>
8884 : MQTT, encrypted, client certificate required<br>
8885 : MQTT, encrypted, authenticated<br>
8887 : MQTT, encrypted, server certificate deliberately expired<br>
…  snip: MQTT over websockets</p>
</blockquote>
<p>I’d like to get them all working with emqtt, for this I installed mosquitto-clients as a reference implementation:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients
</code></pre>
<p>after downloading the provided cert and generating my own (see <a href="https://test.mosquitto.org/" rel="noopener nofollow ugc">https://test.mosquitto.org/</a>) I can successfully test all of them but those that are authenticated, because I’m missing the credentials, anybody know what to use?</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">
mosquitto_sub -h test.mosquitto.org -p 1883 -t "#"
# TODO - whats the password? --- mosquitto_sub --pw ??? -h test.mosquitto.org -p 1884 -t "#"
mosquitto_sub --cafile mosquitto.org.crt -h test.mosquitto.org -p 8883 -t "#"
mosquitto_sub --cafile mosquitto.org.crt --cert client.crt --key client.key -h test.mosquitto.org -p 8884 -t "#"
</code></pre>
<p>EDIT:</p>
<p>emqtt-cli looks almost the same as mosquitto-sub</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">./emqtt sub -h test.mosquitto.org -p 1883 -t "#"
./emqtt sub --enable-ssl --CAfile mosquitto.org.crt -h test.mosquitto.org -p 8883 -t "#"
./emqtt sub --enable-ssl --CAfile mosquitto.org.crt --cert client.crt --key client.key -h test.mosquitto.org -p 8884 -t "#"
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220052" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-220052" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220052"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="220090" data-post-id="220090">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sebb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sebb/120/21818_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sebb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I can’t get SSL to work.</p>
<p>I’ve looked at the opts emqtt-cli generates for</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">./emqtt sub --enable-ssl --CAfile mosquitto.org.crt -h test.mosquitto.org -p 8883 -t "#"
</code></pre>
<p>which is</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">opts = [
  host: 'test.mosquitto.org',
  ssl: true,
  ssl_opts: [cacertfile: "mosquitto.org.crt"]
]
</code></pre>
<p>but I just get a crash:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">iex&gt; {:ok, pid} = :emqtt.start_link(opts)
{:ok, #PID&lt;0.221.0&gt;}
iex&gt;  :emqtt.connect(pid)
{:error, :closed}
** (EXIT from #PID&lt;0.214.0&gt;) shell process exited with reason: :closed
</code></pre>
<p>adding <code>server_name_indication</code> and <code>verify_peer</code> yields the same result.</p>
<p>I can reproduce this in docker <code>elixir:1.11.4</code> and <code>elixir:1.12.2</code> for emqtt 1.2 and 1.4.<br>
Just <code>mix new test_proj</code>, then add to deps <code> {:emqtt, github: "emqx/emqtt", tag: "v1.2.0"}</code> and run:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">sudo docker run --volume $(pwd):/emqtt -w /emqtt -it elixir:1.11.4 bash

$&gt; iex -S mix
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220090" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/any-recommendations-on-a-mqtt-client-for-elixir/41028/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-220090" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220090"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/41028/load_more?page=3">Load more posts (31 remaining)</a>
</div></template></turbo-stream>