title: SSL connection issues between go Scratch container and PG container. How to resolve?
body: <h2>UPDATE</h2>
  <p>I believe I resolved this issue with this connection...</p>
  <pre><code>db, err := gorm.Open(&quot;postgres&quot;, &quot;host='postgres'&amp;user:docker&amp;port=5432&amp;dbname='docker'&amp;password='password'&amp;sslmode=disable&quot;)
  </code></pre>
  <hr />
  <p>I am getting a connection refused between a Docker PG container and a GoLang Scratch container. The error is:</p>
  <pre><code>============   exiting ==========
  todo_1      | pq: SSL is not enabled on the server
  todo_1      | panic: failed to connect database e
  </code></pre>
  <p><a href="https://github.com/vinceyoumans/achal/blob/master/docker-compose.yml" rel="nofollow noreferrer">The docker-compose.yml file </a></p>
  <p><a href="https://github.com/vinceyoumans/achal/blob/master/go_amex/main.go" rel="nofollow noreferrer">The main.go file which is panicking</a></p>
  <p><a href="https://github.com/vinceyoumans/achal" rel="nofollow noreferrer">Complete code base with Docker files</a></p>
  <p>OTHER NOTE:</p>
  <ul>
  <li>I am using GORM library to connect with PG.</li>
  </ul>
  <p>REQUEST:
  Please look over code and give some hints on where and how to resolve this SSL issue.</p>