title: How to setup Spring/Heroku/postgres SSL datasource
body: <p>I'm trying to create a datasource from my Heroku/Spring application to postgres.heroku.com postgres database. Here is my <code>applicationContext.xml</code> snippet.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;bean id="securityDataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName" value="org.postgresql.Driver"/&gt;
      &lt;property name="url" value="jdbc:postgresql://url/dstabase"/&gt;
      &lt;property name="username" value="user"/&gt;
      &lt;property name="password" value="password"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But when I run the app, tomcat gives this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Cannot create PoolableConnectionFactory (FATAL: no pg_hba.conf entry for host "10.11.12.13", user "username", database "database", SSL off)
  </code></pre>
  
  <p>How can I configure it to use SSL? I need it in order to stablish a connection against postgres.heroku.com</p>