0

I wanted to use aiohttp.request in order to get Reddit post, but when I ran the code it gives me this error, any possible solution? Code:

@command(name='meme')
@guild_only()
async def meme_cmd(self, ctx):
   async with request("GET", "https://www.reddit.com/r/meme/", headers={}) as response:
       data = await response.json()
       print(data)

Error:

Command raised an exception: ClientConnectorCertificateError: Cannot connect to host www.reddit.com:443 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname m
ismatch, certificate is not valid for 'www.reddit.com'. (_ssl.c:1123)")]

Cedric
  • 142
  • 10
  • Is there request going through a proxy? Try to access the same URL in chrome and check the Root Certificate authority of the SSL certificate. Is it Digicert or another Root CA that is trusted by your machine? – Yan Oct 07 '20 at 03:48
  • Actually, in my country, Reddit is blocked, but smh I unblock it using host on windows, and anyways this thing only happens when I use request and apraw not with PRAW. but yeah praw cause blocking @Yan And I'm using DigiCert SHA 2 on my browser – Cedric Oct 07 '20 at 10:22

0 Answers0