title: AMQP secure connection / encrypted URI
body: <p>I want to establish an AMQP connection from my Java client to a RabbitMQ AMQP message broker. It actually works fine as described at <a href="https://www.rabbitmq.com/api-guide.html" rel="noreferrer">https://www.rabbitmq.com/api-guide.html</a>.</p>
  
  <p>Im doing:</p>
  
  <pre><code>ConnectionFactory factory = new ConnectionFactory();
  factory.setUsername(userName);
  factory.setPassword(password);
  factory.setVirtualHost(virtualHost);
  factory.setHost(hostName);
  factory.setPort(portNumber);
  Connection conn = factory.newConnection();
  </code></pre>
  
  <p>or as an equivalent the following does the same:</p>
  
  <pre><code>ConnectionFactory factory = new ConnectionFactory();
  factory.setUri("amqp://userName:password@hostName:portNumber/virtualHost");
  Connection conn = factory.newConnection();
  </code></pre>
  
  <p>But am I right in the assumption that my username and password in the URI string are transmitted over the internet in plain? If this is the case, I would like to know how to get this authentication a little more secure.</p>