PoP3 or SMTP Email Account Test Connection Failed with error com.glide.certificates.DBKeyStoreSocketFactoryIssue When conducting a "Test Connection" on a POP3/SMTP email account, you will encounter the following error message:Couldn't connect to host, port: pop3, 995; timeout 20000; Using socket factory class com.glide.certificates.DBKeyStoreSocketFactory ReleaseALLCause-->During the test connection, the ServiceNow platform queries the sys_certificate table to validate all active certificates. -->During this process, if any active certificates appear expired, the action fails and reports the above error.Resolution -->Running this background script helps identify any active expired certificates in the sys_certificate table. -->Navigate to System Definition > Scripts - Background-->Run Below Script to identify expired certificates which are still active in the istance: //Script for validating certificates checkCert(); function checkCert(){ var certValidator = new SNC.CertificateValidator(); var grC = new GlideRecord('sys_certificate'); grC.addActiveQuery(); grC.query(); while (grC.next()){ try { if(!certValidator.validate(grC)) gs.print(gs.getMessage('\n\nInvalid certificate: ') + '\nName: ' + grC.name + '\nType: ' + grC.type + CreateLink('sys_certificate', grC.sys_id) + '\n'); } catch (e){ gs.print(gs.getMessage('\n\nInvalid certificate: ') + '\nName: ' + grC.name + '\nType: ' + grC.type + CreateLink('sys_certificate', grC.sys_id) + '\n'); gs.print(gs.getMessage(e)); continue; } } function CreateLink(strTableName, strSysID){ return "\nLink: " + gs.getProperty('glide.servlet.uri') + gs.generateURL(strTableName, strSysID); } } -->Sample Output: *** Script: Invalid certificate: Name: SAML 2.0 Type: trust_store Link: https://xxxxx.service-now.com/sys_certificate.do?sys_id=210cfd3fe8a902006d0f6afc9ec7eb25 *** Script: java.lang.Exception: Invalid trust_store : certificate expired on 20200804073341GMT+00:00 *** Script: Now, deactivate any expired certificates and retest the connection to the email account.