Fix Python SSL: CERTIFICATE_VERIFY_FAILED Error

You’re making an HTTP request in Python and suddenly: s s l . S S L C e r t V e r i f i c a t i o n E r r o r : [ S S L : C E R T I F I C A T E _ V E R I F Y _ F A I L E D ] c e r t i f i c a t e v e r i f y f a i l e d : u n a b l e t o g e t l o c a l i s s u e r c e r t i f i c a t e Or with requests: ...

April 5, 2026 · 5 min · 963 words · Rob Washington

Fix: Python imaplib search() Returns Empty Results

You’re using Python’s imaplib to search emails, but mail.search() keeps returning empty results even though you know matching emails exist. Here’s why it happens and how to fix it. The Problem 1 2 3 4 5 6 7 8 9 import imaplib mail = imaplib.IMAP4_SSL('imap.gmail.com') mail.login('user@gmail.com', 'app-password') mail.select('INBOX') # This returns nothing! status, messages = mail.search(None, 'FROM "john@example.com" SUBJECT "invoice"') print(messages) # [b''] You’ve verified the emails exist. You can see them in Gmail. But search() returns an empty byte string. ...

March 19, 2026 · 4 min · 791 words · Rob Washington