We have SharePoint 2013 site configured with SSL and we have developed a provider hosted app which interacts with SharePoint list.
If we try accessing the Provider hosted app from the SharePoint site with HTTP there are no any errors thrown.
But whenever the Provider hosted app is tried accessing from the HTTPS SharePoint site(using https address) we are getting below error:
The remote certificate is invalid according to the validation procedure.
Stack trace: [AuthenticationException: The remote certificate is invalid according to the validation procedure.] System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception) +2983172 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) +86 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +262 System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) +473 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) +8530566 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) +230 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +645 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +9 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) +87 System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) +1467 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) +84 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) +22 System.Net.ConnectStream.WriteHeaders(Boolean async) +761
[WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.] System.Net.HttpWebRequest.GetResponse() +8534156 Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() +58 Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb) +975 ProviderHostedHTTPSWeb.Default.Page_Load(Object sender, EventArgs e) +348 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178
We have already added the certificate used for the SharePoint site and the provider hosted app in the SharePoint central admin trusts.
Any idea's how can I resolve this issue?