title: no pg_hba.conf entry for host \"IP-ADDRESS", user \"username\", database \"database\", SSL off
body: <p>I am using <strong>Digitalocean managed PostgreSQL</strong> and trying to access the database from node.js (using <strong>pg-promise</strong>) which is a <strong>Google Cloud Function</strong>.</p>
  <blockquote>
  <p>no pg_hba.conf entry for host &quot;IP-ADDRESS&quot;, user &quot;username&quot;, database &quot;database&quot;, SSL off</p>
  </blockquote>
  <p>Below is my db config</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import * as pgPromise from 'pg-promise';
  const dbConfig = {
      username: 'username',
      password: 'password',
      host: 'host string',
      port: PORTNUMBER,
      database: 'database',
      sslmode: 'require'
  };
  const pgp = pgPromise({});
  const db = pgp(dbConfig);
  export { db, pgp };</code></pre>
  </div>
  </div>
  </p>
  <p>How to fix this? Please advise.</p>