-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Please provide us with the following information:
This issue is for a: (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
The issue was found for the following scenario:
Please add an 'x' for the scenario(s) where you found an issue
- Web app that signs in users
- with a work and school account in your organization: 1-WebApp-OIDC/1-1-MyOrg
- with any work and school account: /1-WebApp-OIDC/1-2-AnyOrg
- with any work or school account or Microsoft personal account: 1-WebApp-OIDC/1-3-AnyOrgOrPersonal
- with users in National or sovereign clouds 1-WebApp-OIDC/1-4-Sovereign
- with B2C users 1-WebApp-OIDC/1-5-B2C
- Web app that calls Microsoft Graph
- Calling graph with the Microsoft Graph SDK: 2-WebApp-graph-user/2-1-Call-MSGraph
- With specific token caches: 2-WebApp-graph-user/2-2-TokenCache
- Calling Microsoft Graph in national clouds: 2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph
- Web app calling several APIs 3-WebApp-multi-APIs
- Web app calling your own Web API
- Web app restricting users
- by Roles: 5-WebApp-AuthZ/5-1-Roles
- by Groups: 5-WebApp-AuthZ/5-2-Groups
- Deployment to Azure
- Other (please describe)
Repro-ing the issue
Repro steps
Run the app, see the website, click on "TodoList"-link.
IOException: The handshake failed due to an unexpected packet format.
Expected behavior
Click the "TodoList"-link and be able to use the TodoList.
Actual behavior
You get this error when clicking the link.
IOException: The handshake failed due to an unexpected packet format.
System.Net.Security.SslState.StartReadFrame(byte[] buffer, int readBytes, AsyncProtocolRequest asyncRequest)
HttpRequestException: The SSL connection could not be established, see inner exception.
System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
Possible Solution
Turn on self-signed SSL certificate or don't use any SSL-certificates.
Additional context/ Error codes / Screenshots


Any log messages given by the failure
Add any other context about the problem here, such as logs.
An unhandled exception occurred while processing the request.
IOException: The handshake failed due to an unexpected packet format.
System.Net.Security.SslState.StartReadFrame(byte[] buffer, int readBytes, AsyncProtocolRequest asyncRequest)
HttpRequestException: The SSL connection could not be established, see inner exception.
System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
IOException: The handshake failed due to an unexpected packet format.
System.Net.Security.SslState.StartReadFrame(byte[] buffer, int readBytes, AsyncProtocolRequest asyncRequest)
System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)
System.Net.Security.SslState.ThrowIfExceptional()
System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
System.Net.Security.SslStream+<>c.<AuthenticateAsClientAsync>b__47_1(IAsyncResult iar)
System.Threading.Tasks.TaskFactory<TResult>.FromAsyncCoreLogic(IAsyncResult iar, Func<IAsyncResult, TResult> endFunction, Action<IAsyncResult> endAction, Task<TResult> promise, bool requiresSynchronization)
System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken)
- You can enable Middleware diagnostics by uncommenting the following lines
- You can enable personally identifiable information in your exceptions to get more information in the open id connect middleware see Seeing [PII is hidden] in log messages
- Logging for MSAL.NET is described at Loggin in MSAL.NET
OS and Version?
Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Windows 10
Versions
of ASP.NET Core, of MSAL.NET
Core 2.2
Attempting to troubleshooting yourself:
- did you go through the README.md in the folder where you found the issue?
Yes
- did you go through the documentation:
Yes
Mention any other details that might be useful
Thanks! We'll be in touch soon.