나는 Heroku 및 asyncpg를 통해 PostgreSQL 데이터베이스를 실행 중입니다. 내 URL은 postgres://user:[email protected]:5432/db_name
입니다. 내가 psycopg2를 사용할 때인증서 확인 실패 PostgreSQL Heroku
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
, 그것은 유효 :이 프로그램을 실행할 때
, 나는 오류가 발생합니다. asyncpg를 사용하면이 오류가 발생합니다.
연결 풀을 사용하지 않으려 고 시도했으나 작동하지 않습니다. 수동으로 사용자, 패스워드 등을 넘기는 것도 효과가 없습니다.
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