web application – Problem with Google OAuth 2 authorization and enabling SSL certificate on my wordpress website

I have a wordpress website. I was using Google login (OAuth 2 authentication) but I had no SSL certificate but Google login was doing pretty well.
But after enabling my SSL certificate (after like 3 or 4 hours) I try to login using Google login but I get an error like this on picture:enter image description here

After seeing that I disabled the SSL certificate on my website and the problem was solved, the login was possible again. but when I re-enable it, the problem still arises.

I thought I might go to Google Console under my project and update client ID URIs to https://mywebsite.com instead of http://mywebsite.com but when I do that I get another error like this on picture:
enter image description here

Please help!