1

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?

  • If you browse to the provider hosted URL from the sharepoint server do you get an https validation error? What about the other way around? – Choggo Oct 28 '14 at 15:26
  • @Choggo I do not receive any HTTPS validation errors if I browse Provider hosted URL form the SSL SharePoint site, but get the above error. But if I browse same provider hosted URL from the SharePoint site with HTTP then I do not get any errors also it works fine. – Vinayak Oct 29 '14 at 6:26
  • Could you rephrase? I'm not sure I understood you completely. Also, what type of SSL certificate are you using? – Choggo Oct 29 '14 at 9:57
  • @Choggo Accessing Provider hosted app form [HTTP SP site] _http://mysharepoint.XXX URL does not throws any error. But if I access Provider hosted app from same application with HTTPS i.e _https://mysharepoint.xxx I'm getting error. SSL certificate used is the Self-signed certificate. – Vinayak Oct 30 '14 at 13:18
  • 1
    @Choggo Thanks for your support. Yes there was an unnoticed warning for self signed certificate. When I used the certificate issued to my SharePoint site it worked without any errors. – Vinayak Nov 10 '14 at 15:06
1

I found solution to my problem.

The problem was due to the self signed certificate which I was using for the SharePoint site. When I tried using the certificate issued particularly to my SharePoint site it worked perfectly without any errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.