[PATCH 6.1&6.6 V3 1/3] sign-file,extract-cert: move common SSL helper functions to a header