运行以下代码以从我的 Azure 应用服务连接到 Azure 应用配置时,我收到以下“无法创建 SSL/TLS 安全通道”异常。
当我在我的开发机器(即连接到 Azure 应用程序配置的开发机器)上运行代码时,我没有问题。请注意,我的 App Service 是: Stack is .NET Framework Version ASP.NET 4.7
当我尝试使用 ManagedIdentityCredential 进行连接时,我得到了同样的错误。
var configurationRoot = configurationBuilder
.AddAzureAppConfiguration(options =>
{
options
.Connect("Endpoint=blah;Id=blah;Secret=blah")
.Select(KeyFilter.Any, LabelFilter.Null)
.Select(prefix + ":*");
}).Build();
导致此错误:
The request was aborted: Could not create SSL/TLS secure channel.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The request was aborted: Could not create SSL/TLS secure channel.]
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +54006511
System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) +83
[HttpRequestException: An error occurred while sending the request.]
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__6.MoveNext() +434
[RequestFailedException: An error occurred while sending the request.]
Azure.Core.Pipeline.<ProcessAsync>d__6.MoveNext() +1073
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessNextAsync>d__10.MoveNext() +802
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__9.MoveNext() +2483
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__5.MoveNext() +763
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__3.MoveNext() +508
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__8.MoveNext() +612
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__7.MoveNext() +508
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__6.MoveNext() +1112
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Azure.Core.Pipeline.<ProcessAsync>d__11.MoveNext() +689
[AggregateException: Retry failed after 3 tries.]
Azure.Core.Pipeline.<ProcessAsync>d__11.MoveNext() +1410
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Microsoft.Extensions.Configuration.AzureAppConfiguration.<ProcessAsync>d__2.MoveNext() +598
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<ProcessAsync>d__1.MoveNext() +513
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Core.Pipeline.<SendRequestAsync>d__10.MoveNext() +570
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Azure.Data.AppConfiguration.<GetConfigurationSettingsPageAsync>d__42.MoveNext() +2153
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Azure.Core.<AsPages>d__2.MoveNext() +479
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token) +119
Azure.<GetAsyncEnumerator>d__6.MoveNext() +1338
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Azure.<GetAsyncEnumerator>d__6.MoveNext() +1895
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Threading.Tasks.Sources.ManualResetValueTaskSourceCore`1.GetResult(Int16 token) +119
Microsoft.Extensions.Configuration.AzureAppConfiguration.<<LoadAll>b__4>d.MoveNext() +783
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Extensions.Configuration.AzureAppConfiguration.<<LoadAll>b__4>d.MoveNext() +1278
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Microsoft.Extensions.Configuration.AzureAppConfiguration.<CallWithRequestTracing>d__4.MoveNext() +809
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Microsoft.Extensions.Configuration.AzureAppConfiguration.<CallWithRequestTracing>d__23.MoveNext() +310
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Extensions.Configuration.AzureAppConfiguration.<LoadAll>d__15.MoveNext() +1606
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Extensions.Configuration.AzureAppConfiguration.<LoadAll>d__15.MoveNext() +2641
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +68
Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.Load() +429
Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers) +292
Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() +249