Made changes to .NET4 and WebSockets to allow setting of certs, proxies,...

Made changes to .NET4 and WebSockets to allow setting of certs, proxies, cookies and creds
- Fixed code analysis

#1908