You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the WebSocket RemoteCertificateValidationCallback is only ever set if RequireClientCertificate is true, which will only be the case when using client certificates.
It should be possible to disable or customize server SSL certificate validation regardless of the auth type being used.
To Reproduce
Create a binding where WebSockets are always enabled, without setting any client certificate auth.
Try to call a service that uses a self-signed SSL certificate, or one that doesn't match the domain.
Expected behavior
The call should succeed.
Actual behavior
Call fails with an error similar to this one:
Exception info dump:
System.ServiceModel.CommunicationException: Unable to connect to the remote server
---> System.Net.WebSockets.WebSocketException (0x80004005): Unable to connect to the remote server
---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
It's possible to disable (or provide custom) SSL validation by setting
SslCertificateAuthentication
like in this example:However, this only works when using client certificate authentication.
Looking at:
wcf/src/System.ServiceModel.Http/src/System/ServiceModel/Channels/ClientWebSocketTransportDuplexSessionChannel.cs
Line 155 in f789e63
It seems like the WebSocket RemoteCertificateValidationCallback is only ever set if RequireClientCertificate is true, which will only be the case when using client certificates.
It should be possible to disable or customize server SSL certificate validation regardless of the auth type being used.
To Reproduce
Expected behavior
The call should succeed.
Actual behavior
Call fails with an error similar to this one:
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: