i am using sitecore 9.0.2 Commerce, On Application startup, i am getting Below ERROR on the log file.
604 17:29:16 INFO Commerce.Connector - Acquiring mapping lock
9604 17:29:16 INFO Commerce.Connector - Mapping locked
9604 17:29:16 INFO Commerce.Connector - Loading the mapping entries
9604 17:29:16 INFO Commerce.Connector - Attempting to connect to CE
23996 17:29:16 ERROR GetCatalogItems(environmentName='CommerceAuthoring',skip=0,take=100)?$expand=CatalogItems($select=Id,SitecoreId,CatalogToEntityList,ParentCatalogList,ParentCategoryList,ChildrenCategoryList,ChildrenSellableItemList,ItemVariations)
System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sitecore.Commerce.Engine.Connect.DataProvider.CatalogRepository.<InvokeHttpClientGetAsync>d__31.MoveNext()
9604 17:29:16 ERROR Commerce.Connector - There was an error retrieving the mappings from the Commerce Service
9604 17:29:16 INFO Commerce.Connector - Loaded the mapping entries - 0 Entries, 0 Parents 0 Templates
9604 17:29:16 INFO Commerce.Connector - Release mapping lock
i have created the commerceengine certificate and added in Trusted Root and Personal.
Below is my Sitecore.Commerce.Engine.Connect.Config
> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
> xmlns:role="http://www.sitecore.net/xmlconfig/role/"> <sitecore
> role:require="Standalone or ContentDelivery or ContentManagement">
> <commerceEngineConfiguration type="Sitecore.Commerce.Engine.Connect.CommerceEngineConfiguration,
> Sitecore.Commerce.Engine.Connect">
> <shopsServiceUrl>https://localhost:5000/api/</shopsServiceUrl>
> <commerceOpsServiceUrl>https://localhost:5000/commerceops/</commerceOpsServiceUrl>
> <commerceRequestTimeout>120</commerceRequestTimeout>
> <enforceSsl>true</enforceSsl>
> <defaultEnvironment>CommerceAuthoring</defaultEnvironment>
> <defaultShopName>CommerceEngineDefaultStorefront</defaultShopName>
> <defaultShopCurrency>USD</defaultShopCurrency>
> <certificateThumbprint>C1C7159CA462E88330D38E3FDA47198CC785F9BF</certificateThumbprint>
> <!-- StoreLoctions:
> CurrentUser = 1
> LocalMachine = 2
> -->
> <certificateStoreLocation>2</certificateStoreLocation>
> <!-- StoreNames:
> AddressBook = 1
> AuthRoot = 2
> CertificateAuthority = 3
> Disallowed = 4
> My = 5
> Root = 6
> TrustedPeople = 7
> TrustedPublisher = 8
> -->
> <certificateStoreName>5</certificateStoreName>
> <certificateHeaderName>X-CommerceEngineCert</certificateHeaderName>
> <!-- Catalog Template Generator Settings -->
> <useDeterministicFieldIdsForEntities>true</useDeterministicFieldIdsForEntities>
> <useDeterministicFieldIdsForComponents>true</useDeterministicFieldIdsForComponents>
> </commerceEngineConfiguration>
> <commands>
> <command name="commerce:generatecatalogdatatemplates" type="Sitecore.Commerce.Engine.Connect.DataProvider.Commands.GenerateTemplatesCommand,
> Sitecore.Commerce.Engine.Connect" />
> <command name="commerce:deletecatalogdatatemplates" type="Sitecore.Commerce.Engine.Connect.DataProvider.Commands.DeleteTemplatesCommand,
> Sitecore.Commerce.Engine.Connect" />
> <command name="commerce:refreshcache" type="Sitecore.Commerce.Engine.Connect.DataProvider.Commands.RefreshCacheCommand,
> Sitecore.Commerce.Engine.Connect" />
> </commands>
> <pipelines>
> <commerce.viewaction.getentityview>
> <processor type="Sitecore.Commerce.Engine.Connect.Pipelines.ViewAction.GetEntityView, Sitecore.Commerce.Engine.Connect" />
> </commerce.viewaction.getentityview>
> <commerce.viewaction.doaction>
> <processor type="Sitecore.Commerce.Engine.Connect.Pipelines.ViewAction.DoAction,
> Sitecore.Commerce.Engine.Connect" />
> </commerce.viewaction.doaction>
> <getContentEditorFields>
> <processor type="Sitecore.Commerce.Engine.Connect.SitecoreDataProvider.Pipelines.ContentEditor.CommerceContentEditorFieldsProcessor,
> Sitecore.Commerce.Engine.Connect" />
> </getContentEditorFields>
> <renderContentEditor>
> <processor patch:before="processor[1]" type="Sitecore.Commerce.Engine.Connect.DataProvider.Pipelines.SetCommerceEditorFormatter,
> Sitecore.Commerce.Engine.Connect" />
> </renderContentEditor>
> <getQueryState>
> <processor type="Sitecore.Commerce.Engine.Connect.DataProvider.Pipelines.ContentEditor.CommandStateProcessor,
> Sitecore.Commerce.Engine.Connect" />
> </getQueryState>
> <getContentEditorWarnings>
> <processor type="Sitecore.Commerce.Engine.Connect.Pipelines.ValidateCertificate,
> Sitecore.Commerce.Engine.Connect" />
> </getContentEditorWarnings>
> <getItemPersonalizationVisibility>
> <processor type="Sitecore.Commerce.Engine.Connect.Pipelines.PersonalizationVisibilityProcessor,
> Sitecore.Commerce.Engine.Connect" />
> </getItemPersonalizationVisibility>
> </pipelines>
> <events>
> <event name="publish:itemProcessing">
> <handler type="Sitecore.Commerce.Engine.Connect.Events.CatalogPublishingExcluderEvent,
> Sitecore.Commerce.Engine.Connect" method="CheckProcessing" />
> </event>
> <event name="publish:end">
> <handler patch:after="processor[@type='Sitecore.Publishing.HtmlCacheClearer,
> Sitecore.Kernel']"
> type="Sitecore.Commerce.Engine.Connect.Events.CommercePublishCacheRefresh, Sitecore.Commerce.Engine.Connect" method="ClearCache" />
> </event>
> <event name="publish:end:remote">
> <handler patch:after="processor[@type='Sitecore.Publishing.HtmlCacheClearer,
> Sitecore.Kernel']"
> type="Sitecore.Commerce.Engine.Connect.Events.CommercePublishCacheRefresh, Sitecore.Commerce.Engine.Connect" method="ClearCache" />
> </event>
> <event name="item:saved">
> <handler type="Sitecore.Commerce.Engine.Connect.Events.CommerceItemEventHandler,
> Sitecore.Commerce.Engine.Connect" method="OnItemSaved" />
> </event>
> <event name="item:deleting">
> <handler type="Sitecore.Commerce.Engine.Connect.Events.CommerceItemEventHandler,
> Sitecore.Commerce.Engine.Connect" method="OnItemDeleting" />
> </event>
> <event name="indexing:completed:remote" role:require="Standalone or ContentDelivery">
> <handler type="Sitecore.Commerce.Engine.Connect.Events.IndexingCompletedEventHandler,
> Sitecore.Commerce.Engine.Connect" method="OnIndexingCompleted" />
> </event>
> </events>
> <hooks role:require="Standalone or ContentDelivery">
> <hook type="Sitecore.Commerce.Engine.Connect.Events.IndexingCompletedHook,
> Sitecore.Commerce.Engine.Connect" />
> </hooks>
> <settings>
> <setting name="Sitecore.Services.SecurityPolicy">
> <patch:attribute name="value">Sitecore.Services.Infrastructure.Web.Http.Security.ServicesOnPolicy,
> Sitecore.Services.Infrastructure</patch:attribute>
> </setting>
> </settings> </sitecore> </configuration>