How to debug "pika.exceptions.AuthenticationError: EXTERNAL" error when establishing TLS connection to RabbitMQ?
<p>I have a RabbitMQ 3.6.1 server on Ubuntu 14.04 running properly. I tried to configure an SSL listener according to <a href="https://www.rabbitmq.com/ssl.html" rel="nofollow">official documentation</a>. No problems during the startup.</p>

<p>However when trying to establish a connection, I get the following error on Python/pika side (full transcript below):</p>

<pre><code>pika.exceptions.AuthenticationError: EXTERNAL
</code></pre>

<p>What does <code>EXTERNAL</code> mean here? How to debug / get further details of the error?</p>

<hr>

<p>Course of actions (to test I used a Vagrant box and a local connection):</p>

<ol>
<li><p>RabbitMQ starts SSL Listener on port 5671 (per <code>/var/log/rabbitmq/rabbit@rabbitmq-server.log</code>):</p>

<pre><code>started SSL Listener on [::]:5671
</code></pre></li>
<li><p>I execute the <code>pika.BlockingConnection</code> on the client side.</p></li>
<li><p>On the server side I can see an incoming connection:</p>

<pre><code>=INFO REPORT==== 17-Apr-2016::17:07:15 ===
accepting AMQP connection &lt;0.2788.0&gt; (127.0.0.1:48404 -&gt; 127.0.0.1:5671)
</code></pre></li>
<li><p>Client fails with:</p>

<pre><code>pika.exceptions.AuthenticationError: EXTERNAL
</code></pre></li>
<li><p>Server timeouts:</p>

<pre><code>=ERROR REPORT==== 17-Apr-2016::17:07:25 ===
closing AMQP connection &lt;0.2788.0&gt; (127.0.0.1:48404 -&gt; 127.0.0.1:5671):
{handshake_timeout,frame_header}
</code></pre></li>
</ol>

<hr>

<p>Full transcript of the client side:</p>

<pre><code>&gt;&gt;&gt; import pika, ssl
&gt;&gt;&gt; from pika.credentials import ExternalCredentials
&gt;&gt;&gt; ssl_options = ({"ca_certs": "/etc/rabbitmq/certs/testca/cacert.pem",
...                 "certfile": "/etc/rabbitmq/certs/client/cert.pem",
...                 "keyfile": "/etc/rabbitmq/certs/client/key.pem",
...                 "cert_reqs": ssl.CERT_REQUIRED,
...                 "server_side": False})
&gt;&gt;&gt; host = "localhost"
&gt;&gt;&gt; connection = pika.BlockingConnection(
...                  pika.ConnectionParameters(
...                      host, 5671, credentials=ExternalCredentials(),
...                      ssl=True, ssl_options=ssl_options))
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 4, in &lt;module&gt;
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 339, in __init__
    self._process_io_for_connection_setup()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 374, in _process_io_for_connection_setup
    self._open_error_result.is_ready)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/blocking_connection.py", line 410, in _flush_output
    self._impl.ioloop.poll()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/select_connection.py", line 602, in poll
    self._process_fd_events(fd_event_map, write_only)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/select_connection.py", line 443, in _process_fd_events
    handler(fileno, events, write_only=write_only)
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 364, in _handle_events
    self._handle_read()
  File "/usr/local/lib/python2.7/dist-packages/pika/adapters/base_connection.py", line 415, in _handle_read
    self._on_data_available(data)
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1347, in _on_data_available
    self._process_frame(frame_value)
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1414, in _process_frame
    if self._process_callbacks(frame_value):
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1384, in _process_callbacks
    frame_value)  # Args
  File "/usr/local/lib/python2.7/dist-packages/pika/callback.py", line 60, in wrapper
    return function(*tuple(args), **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pika/callback.py", line 92, in wrapper
    return function(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pika/callback.py", line 236, in process
    callback(*args, **keywords)
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1298, in _on_connection_start
    self._send_connection_start_ok(*self._get_credentials(method_frame))
  File "/usr/local/lib/python2.7/dist-packages/pika/connection.py", line 1077, in _get_credentials
    raise exceptions.AuthenticationError(self.params.credentials.TYPE)
pika.exceptions.AuthenticationError: EXTERNAL
&gt;&gt;&gt;
</code></pre>