I downloaded the nopCommerce project from Github and on the first run, this is the error I get:
An error occurred while starting the application. Win32Exception: The certificate chain was issued by an authority that is not trusted. Unknown location
SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, bool breakConnection, Action<Action> wrapCloseInAction)
DependencyResolutionException: An exception was thrown while activating λ:Nop.Core.Domain.Common.CommonSettings. Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action<ResolveRequestContext> next)
Win32Exception: The certificate chain was issued by an authority that is not trusted.
Please assist. I see on the internet some solutions suggest setting the Trusted Server Certificate to True but that seems to be the case already. I'm also a bit unsure where such a connection string would be located in the code.
Hi, The "Trusted Server Certificate = True" or "Encrypt = False" can be added (or be found) inside the connection string in the \App_Data\appsettings.json file.
Yes, true. I have mentioned the appsettings.json file because of this (" I'm also a bit unsure where such a connection string would be located in the code").
Are you using the latest version of nopCommerce? - i can see autofac (IoC) in the error info which is quite strange. -Trusted Server Certificate =True or (Encrypt = false) params are only related to the nopCommerce version 4.50.
Also please check out this link https://docs.microsoft.com/en-us/troubleshoot/sql/connect/error-message-when-you-connect
I'm using the latest from the develop branch in the nopCommerce repo. I also went to the mentioned azure documentation. It didn't help.
I'm seeing more info that can help debug this. The error is being thrown at line 234 in nopCommerce\src\Libraries\Nop.Data\EntityRepository.cs. When I look at the query object on that line, it has a DataContext object (of type LinqToDB.DataContext). That object has a ConnectionString attribute in it that looks like the following: Data Source=localhost;Initial Catalog=nopCommerce;Integrated Security=True;Persist Security Info=False
That's where the error is being thrown at. Could the connection string be the issue?
I have just downloaded the code from the develop branch too. I'm using Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64) Sep 24 2019 13:48:23 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 19044: ) .
Thanks for your help, Daniel. I was able to run the project after deleting the project and downloading it anew. I had an old copy of the repo to which I git pulled the latest changes. It probably didn't update to the exact latest copy of the repo. That's why I was getting the errors but it's all working fine now.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.