SharePoint Troubleshooting: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

Environment

SharePoint 2013, Windows Azure AD service as Identity Provider.

Scenario

Using SAML Authentication and was trying to access a service application from SSL enabled Portal. Exported the service application security certificate and imported into SharePoint Trusted Root Certificate authority

Problem

Following is the error message when trying to connect to service application from SharePoint.  “The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel”.

Resolution

The imported certificate is having some validation error. The problem was incorrect host name used in certificates. 
We were accessing the URL using the IP and the certificate is using the server name as ip-AC1F08ED. The resolution is either we should have service application URL with fully qualified domain name or the certificate issue should point to the server IP.

https://lh6.googleusercontent.com/c3__ovFlflDmIUvxDcmAG7Ft0YWjcDCLeDL2Ga3SkPETYeZeaFHEPIegNeDSvtZkXMBozx680sRuqY_zgcYAjbWm1-ZkbvTjuPUeqQrBsmmqOXJUfnGEULDyWNcFp4pYVLKwGic

Following error in event viewer. 
Error: "An operation failed because the following certificate has validation errors"

https://lh4.googleusercontent.com/jdphokAE6e8vLz-uhmAie31-uu4rf9PLBqOs4Jdu4omN6tfWVcjJMJNLTzgBSeLvkBh41rJRCqWSVnFSrtTj_LpKDjAoQp0laPCZsjfpyZnw7zoz0DPznNENhLU26Ii9I_1a89o