From 81c29ac0045585a0272d28b03531908372070b3b Mon Sep 17 00:00:00 2001 From: Jorge Beserra Date: Sat, 26 Dec 2020 16:47:46 -0300 Subject: [PATCH] Version 1.0.12 Bug fix issue #54 - Set SSL Protocol tls (Thanks @jeffersonmello) --- Sample/IqOptionApiDotNet.Samples/Program.cs | 2 +- src/IqOptionApiDotNet/Http/IqOptionHttpClient.cs | 4 ++-- src/IqOptionApiDotNet/IqOptionApiDotNet.csproj | 12 +++++------- src/IqOptionApiDotNet/IqOptionApiDotNetClient.cs | 1 - src/IqOptionApiDotNet/Wss/IqOptionWebSocketClient.cs | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Sample/IqOptionApiDotNet.Samples/Program.cs b/Sample/IqOptionApiDotNet.Samples/Program.cs index 3949cdf..5a96179 100644 --- a/Sample/IqOptionApiDotNet.Samples/Program.cs +++ b/Sample/IqOptionApiDotNet.Samples/Program.cs @@ -14,7 +14,7 @@ public static void Main(string[] args) // Projects > IqOptionApiDotNet.Sampes Properties (Debug option) // In Environment Variables, the following options // IqOptionUserName: - // IqOptionPassord: + // IqOptionPassword: // Uncomment the lines below to run the examples diff --git a/src/IqOptionApiDotNet/Http/IqOptionHttpClient.cs b/src/IqOptionApiDotNet/Http/IqOptionHttpClient.cs index d3e8fb8..3c11ff5 100644 --- a/src/IqOptionApiDotNet/Http/IqOptionHttpClient.cs +++ b/src/IqOptionApiDotNet/Http/IqOptionHttpClient.cs @@ -76,9 +76,10 @@ public Task> LoginAsync() switch (t.Result.StatusCode) { + case HttpStatusCode.OK: { - + var resultSsid = t.Result.Content.JsonAs(); var result = t.Result.Content.JsonAs>(); @@ -97,7 +98,6 @@ public Task> LoginAsync() var error = t.Result.Content.JsonAs>(); error.IsSuccessful = false; tcs.TrySetResult(error); - break; } } diff --git a/src/IqOptionApiDotNet/IqOptionApiDotNet.csproj b/src/IqOptionApiDotNet/IqOptionApiDotNet.csproj index d34da6a..f061851 100644 --- a/src/IqOptionApiDotNet/IqOptionApiDotNet.csproj +++ b/src/IqOptionApiDotNet/IqOptionApiDotNet.csproj @@ -18,17 +18,15 @@ based in Iqoption Api for DOTNET - https://github.com/MongkonEiadon/Iqoption.Net https://github.com/JorgeBeserra/IqOptionApiDotNet https://github.com/JorgeBeserra/IqOptionApiDotNet en-US - News -- GetBalancesAsync (Thanks @leobasilio) -- GetExposure (Thanks @leobasilio) -- GetProfit (Thanks @leobasilio) + Bug fix issue #54 +- Set SSL Protocol tls (Thanks @jeffersonmello) 1701;1702;1705;1591 IqOptionApiDotNet IqOptionApiDotNet IqOptionApiDotNet - 1.0.0.11 - 1.0.0.11 - 1.0.11 + 1.0.0.12 + 1.0.0.12 + 1.0.12 logoapi.ico LogoApi128x128.png diff --git a/src/IqOptionApiDotNet/IqOptionApiDotNetClient.cs b/src/IqOptionApiDotNet/IqOptionApiDotNetClient.cs index 09398c6..7c8adcd 100644 --- a/src/IqOptionApiDotNet/IqOptionApiDotNetClient.cs +++ b/src/IqOptionApiDotNet/IqOptionApiDotNetClient.cs @@ -58,7 +58,6 @@ public Task ConnectAsync() tcs.TrySetResult(true); return; } - _logger.LogInformation( $"{Username} logged in failed due to {t.Result?.Errors?.GetErrorMessage()}"); tcs.TrySetResult(false); diff --git a/src/IqOptionApiDotNet/Wss/IqOptionWebSocketClient.cs b/src/IqOptionApiDotNet/Wss/IqOptionWebSocketClient.cs index ea64c7e..b3bc2b9 100644 --- a/src/IqOptionApiDotNet/Wss/IqOptionWebSocketClient.cs +++ b/src/IqOptionApiDotNet/Wss/IqOptionWebSocketClient.cs @@ -137,8 +137,8 @@ protected virtual void InitialSocket(string secureToken) { string requestId; - WebSocketClient.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12; WebSocketClient = new WebSocket("wss://iqoption.com/echo/websocket"); + WebSocketClient.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12; WebSocketClient.OnError += (sender, args) => { _logger.LogError($"WebSocket Error : {args.Message}");