Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF signalr client fails to connect to hub via web socket after updating to .NET 6 RC #36652

Closed
BrennanConroy opened this issue Sep 17, 2021 · 10 comments
Labels
area-signalr Includes: SignalR clients and servers Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.

Comments

@BrennanConroy
Copy link
Member


Issue moved from aspnet/SignalR-samples#114


From @vinaykapoor on Thursday, September 16, 2021 9:12:53 PM

I have a WPF application which connects via signalr websockets. Prior to updating to .NET 6 RC, I was able to connect to the hub however after the update I get a 401 and get the following messages
--After updating
net6.0-windows10.0.19041

16:56:14.646|DEBUG|Connection id "0HMBPACG2TKSM" accepted.
16:56:14.646|DEBUG|Connection id "0HMBPACG2TKSM" started.
16:56:14.664|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:56:14.664|DEBUG|The request is insecure. Skipping HSTS header.
16:56:14.664|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:56:14.664|DEBUG|Request matched endpoint '/orderHub'
16:56:14.664|DEBUG|AuthenticationScheme: Negotiate was not authenticated.
16:56:14.664|INFO|Authorization failed. These requirements were not met:
DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
16:56:14.664|DEBUG|Challenged 401 Negotiate.
16:56:14.664|INFO|AuthenticationScheme: Negotiate was challenged.
16:56:14.664|DEBUG|Connection id "0HMBPACG2TKSM" completed keep alive response.
16:56:14.664|INFO|Request finished HTTP/1.1 GET http://netsbappw03:52976/orderHub - - - 401 0 - 6.8255ms
16:56:14.701|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:56:14.701|DEBUG|The request is insecure. Skipping HSTS header.
16:56:14.701|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:56:14.701|DEBUG|Request matched endpoint '/orderHub'
16:56:14.701|INFO|Incomplete Negotiate handshake, sending an additional 401 Negotiate challenge.
16:56:14.701|DEBUG|Connection id "0HMBPACG2TKSM" completed keep alive response.
16:56:14.701|INFO|Request finished HTTP/1.1 GET http://netsbappw03:52976/orderHub - - - 401 0 - 5.4285ms
16:56:14.718|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:56:14.718|DEBUG|The request is insecure. Skipping HSTS header.
16:56:14.718|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:56:14.718|DEBUG|Request matched endpoint '/orderHub'
16:56:14.718|INFO|Incomplete Negotiate handshake, sending an additional 401 Negotiate challenge.
16:56:14.718|DEBUG|Connection id "0HMBPACG2TKSM" completed keep alive response.
16:56:14.718|INFO|Request finished HTTP/1.1 GET http://netsbappw03:52976/orderHub - - - 401 0 - 5.0385ms
16:56:14.734|DEBUG|Connection id "0HMBPACG2TKSM" received FIN.
16:56:14.734|DEBUG|Connection id "0HMBPACG2TKSM" disconnecting.
16:56:14.734|DEBUG|Connection id "0HMBPACG2TKSM" sending FIN because: "The client closed the connection."
16:56:14.741|DEBUG|Connection id "0HMBPACG2TKSM" stopped.
Heartbeat

Before updating
net5.0-windows10.0.19041
16:57:47.896|DEBUG|Connection id "0HMBPACG2TKSN" accepted.
16:57:47.896|DEBUG|Connection id "0HMBPACG2TKSN" started.
16:57:47.933|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:57:47.933|DEBUG|The request is insecure. Skipping HSTS header.
16:57:47.933|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:57:47.933|DEBUG|Request matched endpoint '/orderHub'
16:57:47.933|DEBUG|AuthenticationScheme: Negotiate was not authenticated.
16:57:47.937|INFO|Authorization failed. These requirements were not met:
DenyAnonymousAuthorizationRequirement: Requires an authenticated user.
16:57:47.937|DEBUG|Challenged 401 Negotiate.
16:57:47.937|INFO|AuthenticationScheme: Negotiate was challenged.
16:57:47.937|DEBUG|Connection id "0HMBPACG2TKSN" completed keep alive response.
16:57:47.937|INFO|Request finished HTTP/1.1 GET http://netsbappw03:52976/orderHub - - - 401 0 - 6.5964ms
16:57:47.980|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:57:47.980|DEBUG|The request is insecure. Skipping HSTS header.
16:57:47.980|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:57:47.980|DEBUG|Request matched endpoint '/orderHub'
16:57:47.980|INFO|Incomplete Negotiate handshake, sending an additional 401 Negotiate challenge.
16:57:47.984|DEBUG|Connection id "0HMBPACG2TKSN" completed keep alive response.
16:57:47.984|INFO|Request finished HTTP/1.1 GET http://netsbappw03:52976/orderHub - - - 401 0 - 4.6097ms
16:57:48.005|INFO|Request starting HTTP/1.1 GET http://netsbappw03:52976/orderHub - -
16:57:48.005|DEBUG|The request is insecure. Skipping HSTS header.
16:57:48.005|DEBUG|1 candidate(s) found for the request path '/orderHub'
16:57:48.005|DEBUG|Request matched endpoint '/orderHub'
16:57:48.018|DEBUG|Completed Negotiate authentication.
16:57:48.018|DEBUG|AuthenticationScheme: Negotiate was successfully authenticated.
16:57:48.018|DEBUG|Authorization was successful.
16:57:48.018|INFO|Executing endpoint '/orderHub'
16:57:48.018|DEBUG|New connection S2LT9th78VCe_WVyJiAftw created.
16:57:48.018|DEBUG|Establishing new connection.
16:57:48.018|DEBUG|OnConnectedAsync started.
16:57:48.018|DEBUG|Socket opened using Sub-Protocol: '(null)'.
16:57:48.086|DEBUG|Found protocol implementation for requested protocol: messagepack.
16:57:48.086|DEBUG|Completed connection handshake. Using HubProtocol 'messagepack'.
/mon/admin/getpermissionedobjects {"application":"APEX","allObjects":false,"requestId":"ef22ee92eac64ea491aa3ddc10635a152","requestor":"vkapoor","timestamp":null}
Write complete.
16:57:48.172|INFO|Connected : S2LT9th78VCe_WVyJiAftw User :vkapoor On :WebSockets
Heartbeat
Listener Hearbeat count: 0
16:57:52.553|DEBUG|Received hub invocation: InvocationMessage { InvocationId: "11", Target: "Heartbeat", Arguments: [ ], StreamIds: [ ] }.

Connecting to a signalr hub using websockets only through the WPF signalr client has caused issues in earlier versions too. This should be fairly straight forward . Since this is a release candidate can this be fixed.

@BrennanConroy
Copy link
Member Author


Issue moved from aspnet/SignalR-samples#114


From @vinaykapoor on Friday, September 17, 2021 3:56:35 PM

I am using signalrclient 6.0.0.rc.1.21452

@BrennanConroy
Copy link
Member Author

@vinaykapoor This is the correct repo.

Is the client version the only thing you changed to see the different behavior?

@vinaykapoor
Copy link

Yes the client is the only one which is displaying this issue.

thank you

@vinaykapoor
Copy link

I am using Signalr Client version 6.0.0.-rc.1.21452.15

@BrennanConroy
Copy link
Member Author

Just updating the client from 5.0 to 6.0 doesn't cause any issues for me, can still connect with Negotiate auth with WebSockets from a WPF app.

Can you provide a minimal repro app with client and server

@BrennanConroy BrennanConroy added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Sep 17, 2021
@Pilchie Pilchie added the area-signalr Includes: SignalR clients and servers label Sep 17, 2021
@vinaykapoor
Copy link

I was able to replicate the issue. I am using a Kestrel to listen via web socket using the following web builder.UseKestrel(opts=>opts.ListenAnyIp()). When I try to connect to the server from the client using the IP it works . But when I try to connect using machine name, the client does not connect. It was a change that was affected in .NET 6. If you change the platform target to .net5 it connects using hostname. I have a test project to replicate this. I will upload it today, but you could easily replicate on your end.

@vinaykapoor
Copy link

I don't think the issue is with signalr , its with Kestrel on .NET 6. Please have a look at this. On the client front I receive a target principle name is incorrect.

@vinaykapoor
Copy link

If there has to be additional steps that need to be implemented I will appreciate if there could be a write up explaining this change to .net 6, considering it works fine on .NET 5.

@BrennanConroy
Copy link
Member Author

I have a test project to replicate this. I will upload it today

Any updates?

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Sep 22, 2021
@BrennanConroy
Copy link
Member Author

Closing as there haven't been any updates and the issue cannot be reproduced.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-signalr Includes: SignalR clients and servers Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Projects
None yet
Development

No branches or pull requests

3 participants