I found solution to this problem.
The issue was due to the self signed certificate which I was using for the SharePoint site. When I used the certificate issued particularly to my SharePoint site it worked without any errors.
i saw your solution for the below thread https://social.msdn.microsoft.com/Forums/expression/en-US/1a32b892-08c6-43e7-b988-667fc6ef1aa3/https-sharepoint-site-with-https-provider-hosted-app-the-remote-certificate-is-invalid-according?forum=sharepointdevelopment
Can you please explain more details about the solution you provided because i am getting same error