Error connecting to POP/IMAP/SMTP Email Account Server on secure portIssue When performing a "Test Connection" on Email Account records, you may observe a similar error message as below: Email account connection test completed with result: error, msg: Connection failed: Couldn't connect to host, port: <SERVER>, <PORT>; timeout 20000; Using socket factory class com.glide.certificates.DBKeyStoreSocketFactoryCauseThis issue can be caused by Active but invalid Certificate(s) in the X.509 Certificates [sys_certificate] table.ResolutionIn your instance: Navigate to System Definition > Certificates.Show only Active certificates by filtering on "Active is true".For each Certificate record: Open the recordClick on "Validate Stores/Certificates" under Related LinksIf the certificate does not validate successfully, perform one of he following: Fix itUncheck the Active flag and Save the record If after de-activating the invalid certificate(s) does not resolve the issue, then the only likely scenario is that for one (or more) of the keystores the password for unlocking the keystore and the keypair does not match. You will have to deactivate the keystores one by one to find the culprit(s). This is a limitation within ServiceNow that the passwords for the keystore and keypair must match.Related LinksHow to identify list of invalid certificates in a ServiceNow instance?