dotnet / dotnet/systemweb-adapters

SystemWebAdapters v2.0.0 - The SSL connection could not be established - The requested function is not supported

Open
#614 2 comments 0 reactions 0 assignees View on GitHub
Needs: Triage :mag:
Dominant language
C#
Stars
384
Forks
76
Avg merge
2h 24m
Merged PRs (30d)
1

Description

We are using system web adapters v2.0.0 in our old webclient (.NET 4.8.1 - asp.net mvc 5) and new webclient (.NET 9 asp.net core mvc) during migration to .NET 9.0

The new client is configured with BackchannelHandler to connect to the old client as client. (+ data protection keys.xml is stored in azure blob storage)
In azure the app service is configured with minTlsVersion = 1.3
```csharp
.AddRemoteAppClient(options =>
{
// Core app will communicate with legacy app
options.RemoteAppUrl = new Uri(oldWebClientUri);
options.ApiKey = systemWebAdaptersApiKey;

// Configure HttpClient to support TLS 1.2/1.3 for communication with old .NET Framework 4.8.1 webclient
options.BackchannelHandler = new SocketsHttpHandler()
{
SslOptions = new System.Net.Security.SslClientAuthenticationOptions
{
// Support both TLS 1.2 and 1.3 (old webclient supports 1.2, new supports 1.3)
// old webclient has minTlsVersion = 1.2
EnabledSslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13
}
};
})
```

The old client is configured in in global.asax.cs (+ data protection keys.xml is stored in azure blob storage)
In azure the app service is configured with minTlsVersion = 1.2
```csharp
this.AddSystemWebAdapters()
.AddJsonSessionSerializer(options =>
{
options.RegisterKey("MachineName");
options.RegisterKey("SessionStartTime");
})
.AddProxySupport(options =>
{
options.UseForwardedHeaders = true;
})
.AddRemoteAppServer(options =>
{
// act as server to share info with ASP.NET Core app
options.ApiKey = ConfigurationManager.AppSettings["RemoteAppApiKey"];
})
.AddAuthenticationServer() // For authentication sharing
.AddSessionServer(); // For session sharing
```

Locally it works, but in my deployed azure app services I fail to establish the SSL connection while accessing remote session on app startup:
{"The SSL connection could not be established, see inner exception."} - SecureConnectionError
The requested function is not supported

(source = System.Net.Http)
at System.Net.Http.ConnectHelper.d__2.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at System.Net.Http.HttpConnectionPool.d__51.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at System.Net.Http.HttpConnectionPool.d__101.MoveNext()
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.d__1.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at System.Net.Http.HttpConnectionWaiter`1.d__6.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at System.Net.Http.HttpConnectionPool.d__50.MoveNext()
at System.Net.Http.DiagnosticsHandler.d__10.MoveNext()
at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1.ConfiguredValueTaskAwaiter.GetResult()
at System.Net.Http.RedirectHandler.d__4.MoveNext()
at System.Net.Http.HttpClient.<g__Core|83_0>d.MoveNext()
at Microsoft.AspNetCore.SystemWebAdapters.SessionState.RemoteSession.SingleConnectionWriteableRemoteAppSessionStateManager.d__1.MoveNext()
at Microsoft.AspNetCore.SystemWebAdapters.SessionState.RemoteSession.RemoteAppSessionStateManager.d__16.MoveNext()
at Microsoft.AspNetCore.SystemWebAdapters.SessionState.RemoteSession.RemoteAppSessionDispatcher.d__7.MoveNext()
at Microsoft.AspNetCore.SystemWebAdapters.SessionLoadMiddleware.d__7.MoveNext()
at Microsoft.AspNetCore.SystemWebAdapters.PreBufferRequestStreamMiddleware.d__2.MoveNext()
at Microsoft.AspNetCore.Session.SessionMiddleware.d__8.MoveNext()
at Microsoft.AspNetCore.Session.SessionMiddleware.d__8.MoveNext()
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<g__Awaited|10_0>d.MoveNext()

Any idea what i am doing wrong or I miss some configuration settings on old or new webclient side?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.