Trap missing certificate exception to avoid bootloop (cherry picked from commit 78c7372a0d64e15734b14b0ca9852ae7c0a47132)