title: Certificate Verify Failed Postgresql Heroku
body: <p>I am running a PostgreSQL database through Heroku and asyncpg. My url is: <code>postgres://user:pass@ec2-23-21-76-49.compute-1.amazonaws.com:5432/db_name</code>.</p>
  
  <p>When I run this, I get the error:</p>
  
  <pre><code>ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
  </code></pre>
  
  <p>This database url definitely works, it is valid when I use psycopg2. Just when I use asyncpg, I get this error. </p>
  
  <p>I have tried not using a connection pool, that does not work either. Manually passing the user, password, etc. does not work either.</p>
  
  <pre><code>class Database:
      """Accessing database functions"""
      def __init__(self, bot):
          self.bot = bot
          try:
              self.dsn = os.environ["DATABASE_URL"]
          except KeyError:
              database_file = open('database_secret.txt', mode='r')
              self.dsn = database_file.read()
              database_file.close()
  
          self.pool = None
          self.prefix_conn = None
          self.prefix_stmt = None
          print(self.dsn)
  
          lop = asyncio.get_event_loop()
          lop.run_until_complete(self.init())
  
      async def init(self):
          self.pool = await asyncpg.create_pool(self.dsn, ssl=True)
          # It fails here
  </code></pre>