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

- Fixed code analysis
#1908
Made changes as per code review feedback

#1908