Python InsecurePlatformWarning

碰到這個歡樂的錯誤,其實已經碰過兩三次了,前面幾次都不了了之。

InsecurePlatformWarning: A true SSLContext object is not available.

這次是確實的找到方法可以不用改程式避掉的方法,方法很簡單,就是安裝 pyopenssl ndg-httpsclient pyasn1 這幾個模組,這幾個模組會自動將 SSL 相關的憑證注射到 urllib3 模組裡,下載時就不會有 InsecurePlatformWarning 的警告。

這方法是在 StackOverflow 的 python – InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately 看到解法的,感謝。