Skip to content

Commit

Permalink
Fixes #205 by forcing TLS 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dgosbell committed Jul 30, 2019
1 parent 53fd5f9 commit 6d20cc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DaxStudio.UI/Model/DaxFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ public class DaxFormatterResult
public class DaxFormatterProxy
{

static DaxFormatterProxy()
{
// force the use of TLS 1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
}

private static string redirectUrl = null; // cache the redirected URL
private static string redirectHost = null;
//public static async Task FormatQuery(DocumentViewModel doc, DAXEditor.DAXEditor editor)
Expand Down
6 changes: 6 additions & 0 deletions src/DaxStudio.UI/Utils/WebRequestFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ namespace DaxStudio.UI.Utils

public class WebRequestFactory: IHandle<UpdateGlobalOptions>
{
static WebRequestFactory()
{
// Force the use of TLS1.2
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
}

[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int connDescription, int ReservedValue);

Expand Down

0 comments on commit 6d20cc8

Please sign in to comment.