I would try including a module like Crypt::SSLeay. That's my suggestion after reading this. Also, I know that oftentimes test servers have weaker certificates than production servers...perhaps your script is choking on a 1024 bit certificate from the prod site and can manage a 512 bit certificate.