Hi, I have a problem with a new Cosmos account service. I have never deployed one before.
Both the App Service and the Cosmos database account have private endpoints. Both private endpoints are in the same vnet and subnet. It seems the App Service cannot connect to the Cosmos database due to RemoteCertificateNameMismatch.
All references to resources use standard Microsoft FQDNs as this is in Dev, so no custom certificates are used. As all certificates are therefore MS controlled I wouldn't have expected a RemoteCertificateNameMismatch to happen?
These are the steps that the application goes through…
- Uploads doc to blob storage
- Writes to SQL DB (not Cosmos) of the link to the file in blob storage
- Writes to SQL DB (not Cosmos) to create a conversation entry
- External library reads doc as filestream and converts/reads tokens
- Checks if doc is of certain size (txt size exceeds token limit set)
- Breaks down to chunks – the Log Stream on the backend App Service shows the following so confirms the process gets this far: Processed document alices-adventures-in-wonderland 1.pdf with content type application/pdf into 38 chunks
- Connect to the Cosmos database to upload the chunks to the database… this is the part that appears to be related to the failure.
- … app should then continue on to further steps
_
App Service backend application Log Stream:
2025-02-12T08:51:29.8020806Z System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception._
2025-02-12T08:51:29.8020837Z ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch
2025-02-12T08:51:29.8020861Z at System.Net.Security.SslStream.CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
2025-02-12T08:51:29.8020893Z at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter]
_2025-02-12T08:51:29.8020924Z at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
_
Any assistance/guidance would be very much appreciated.
Thanks,
Tim.