Secure Socket Error code -54: certificate has expired even though certificate appears to be valid.
This article discussed how to address "certificate has expired" when trying to connect to a secure remote endpoint, even though the connection succeeds using 3rd party tools.