Sitecore Content Hub is a powerful tool for managing digital assets and content. When it comes to integrating Content Hub with your Sitecore instance, you may encounter some weird challenges. One of the issues that users may face is the "Authentication failed because the remote party has closed the transport stream" error. In this article, we will explore the causes of this error and how to resolve it.
The Scenario
Imagine you have a Sitecore instance running on Azure PaaS, and you've installed the Content Hub connector. Everything seems to be working smoothly – you can retrieve images and links from the Digital Asset Management (DAM) system and display them in Image and Rich Text fields. However, trouble arises when you attempt to use the "Insert DAM link" feature within the General Link field. Instead of successfully inserting a link, you encounter the perplexing "Authentication failed" error.
General link field error for Sitecore Content Hub |
Initial Troubleshooting
Naturally, our first instinct is to check our credentials. We've logged into Content Hub in another browser tab, and there don't seem to be any issues with authentication for Image and Rich Text fields. The problem only arises when interacting with the General Link field as
Checking internal code
Digging deeper into the issue, we examine the code responsible for communicating with the Content Hub API. This line of code is executed exclusively when we use the "Insert DAM link" command within the General Link field which basically retrieves additional properties.
value = GetAdditionalPropertyValue(chKey, DAMHelper.GetEntity(long.Parse(result[Constants.SelectedAssetId])));
Suspecting TLS Issue
At this point, we might suspect a Transport Layer Security (TLS) issue, as TLS configuration can sometimes lead to connectivity problems. However, we verify that our development environment is configured to use TLS 1.2, eliminating TLS as the root cause.
Azure VNET to the Rescue
With conventional troubleshooting avenues exhausted, we turn our attention to our Azure Virtual Network (VNET) configuration. After reviewing our VNET traffic rules, we discover the key to resolving the issue. We open up the traffic for the Sitecore Content Hub URL at the Azure VNET level.
The Solution
To our relief, this Azure VNET setting proves to be the missing piece of the puzzle. Once we've made the necessary adjustments, the "Authentication failed" error becomes a thing of the past. The General Link field now functions seamlessly, and we can insert DAM links without encountering any connectivity problems.
Finally
Troubleshooting errors like "Authentication failed because the remote party has closed the transport stream" can be a complex process. It often requires a systematic approach to identify the root cause and find a solution. In this case, a careful examination of the code, consideration of TLS configurations, and ultimately, the adjustment of Azure VNET settings, resolved the issue.
By sharing this experience, we hope to assist others who may encounter similar challenges when using Sitecore Content Hub connectors. Remember that troubleshooting can be a learning opportunity, and persistence often leads to a successful resolution.