While connecting to Dynamics 365 – Version 126.96.36.199 online through a console application using Visual Studio 2015
we were getting the below error
The fix was to specify the security protocol to be Tls12 for the connection for VS 2015 and for VS 2017 make sure the framework version is 4.6 or above.
More Details – https://support.microsoft.com/en-nz/help/4051700
Hope it helps..