Hello! I had this problem. What you need to do is add this to the top of your code:
import ssl ssl.match_hostname = lambda cert, hostname: Trueand for the other error, just close and open the app. Hope it works for you!
Just what I needed, worked a treat, thank you!