Also discovered while looking at ClientWebSocket code.
If the user both passes a custom HttpMessageInvoker and sets security options like Credentials or RemoteCertificateValidationCallback, they seem to be just silently ignored, as the passed HttpMessageInvoker will be used without checking the options.
|
invoker ??= new HttpMessageInvoker(SetupHandler(options, out disposeHandler)); |
This might result in security issues.
Unless I miss something and there are checks somewhere that I haven't found, I believe we should forbid setting the security options in case a custom invoker is passed.
cc @greenEkatherine