Skip to content

Commit

Permalink
Merge branch 'release/2.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindaugas Veblauskas committed Dec 1, 2022
2 parents cc5dc6c + 96412cf commit b62859a
Show file tree
Hide file tree
Showing 67 changed files with 677 additions and 438 deletions.
84 changes: 0 additions & 84 deletions COPYING.md

This file was deleted.

1 change: 0 additions & 1 deletion Setup/ProtonVPN.aip
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
<ROW File="ProtonVPN.IpFilter.dll_1" Component_="ProtonVPN.IpFilter.dll_1" FileName="PROTON~2.DLL|ProtonVPN.IpFilter.dll" Attributes="0" SourcePath="..\src\bin\x64\ProtonVPN.IpFilter.dll" SelfReg="false"/>
<ROW File="ProtonVPN.NetworkFilter.dll" Component_="ProtonVPN.NetworkFilter.dll" FileName="PROTON~8.DLL|ProtonVPN.NetworkFilter.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\ProtonVPN.NetworkFilter.dll" SelfReg="false"/>
<ROW File="ProtonVPN.TlsVerify.exe" Component_="ProtonVPN.TlsVerify.exe" FileName="PROTON~5.EXE|ProtonVPN.TlsVerify.exe" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\ProtonVPN.TlsVerify.exe" SelfReg="false"/>
<ROW File="COPYING.md" Component_="ProtonVPN.ErrorMessage.exe.config" FileName="COPYING.md" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\COPYING.md" SelfReg="false"/>
<ROW File="LICENSE" Component_="ProtonVPN.ErrorMessage.exe.config" FileName="LICENSE" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\LICENSE" SelfReg="false"/>
<ROW File="Polly.Contrib.WaitAndRetry.dll" Component_="Polly.Contrib.WaitAndRetry.dll" FileName="POLLYC~1.DLL|Polly.Contrib.WaitAndRetry.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\Polly.Contrib.WaitAndRetry.dll" SelfReg="false"/>
<ROW File="DeviceId.dll" Component_="DeviceId.dll" FileName="DeviceId.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\DeviceId.dll" SelfReg="false"/>
Expand Down
3 changes: 2 additions & 1 deletion src/Api/ProtonVPN.Api/ApiExceptionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using System.Net.Sockets;
using Newtonsoft.Json;
using Polly.Timeout;
using ProtonVPN.Api.Contracts.Exceptions;
using ProtonVPN.Dns.Contracts.Exceptions;

namespace ProtonVPN.Api
Expand All @@ -31,7 +32,7 @@ public static class ApiExceptionHelper
public static bool IsApiCommunicationException(this Exception ex)
{
return ex is HttpRequestException or JsonException or OperationCanceledException
or TimeoutRejectedException or SocketException or DnsException;
or TimeoutRejectedException or SocketException or DnsException or AlternativeRoutingException;
}
}
}
9 changes: 7 additions & 2 deletions src/Dns/ProtonVPN.Dns/Resolvers/DnsOverHttpsResolverBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,17 @@ private async Task<DnsResponse> TryRequestAsync(DnsOverHttpsParallelHttpRequestC
if (e.IsOrAnyInnerIsOfExceptionType<OperationCanceledException>())
{
LogOperationCancelled($"The DNS over HTTPS provider '{config.ProviderUrl}' " +
$"was canceled when resolving host '{config.Host}'.");
$"was canceled when resolving host '{config.Host}'.");
}
else if (e is DnsException)
{
Logger.Error<DnsErrorLog>($"The DNS over HTTPS provider '{config.ProviderUrl}' " +
$"failed when resolving host '{config.Host}'. Reason: {e.Message}");
}
else
{
Logger.Error<DnsErrorLog>($"The DNS over HTTPS provider '{config.ProviderUrl}' " +
$"failed when resolving host '{config.Host}'.", e);
$"failed when resolving host '{config.Host}'.", e);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
[assembly: AssemblyVersion("2.2.1.0")]
[assembly: AssemblyFileVersion("2.2.1.0")]
[assembly: ComVisible(false)]
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,83 @@
using System.Security.Cryptography.X509Certificates;
using Microsoft.Web.WebView2.Core;
using ProtonVPN.Api.Handlers.TlsPinning;
using ProtonVPN.Common.Logging;
using ProtonVPN.Common.Logging.Categorization.Events.AppLogs;
using ProtonVPN.HumanVerification.Contracts;

namespace ProtonVPN.HumanVerification.Gui
{
public partial class WebView
{
private readonly ICertificateValidator _certificateValidator;
private readonly IHumanVerificationConfig _humanVerificationConfig;
private readonly ILogger _logger;

public WebView(ICertificateValidator certificateValidator,
IHumanVerificationConfig humanVerificationConfig)
IHumanVerificationConfig humanVerificationConfig,
ILogger logger)
{
_certificateValidator = certificateValidator;
_humanVerificationConfig = humanVerificationConfig;
_logger = logger;
InitializeComponent();
if (humanVerificationConfig.IsSupported())
InitializeWebView();
}

private void InitializeWebView()
{
try
{
if (_humanVerificationConfig.IsSupported())
{
WebView2.CoreWebView2InitializationCompleted += OnCoreWebView2InitializationCompleted;
}
}
catch (Exception e)
{
WebView2.CoreWebView2InitializationCompleted += OnCoreWebView2InitializationCompleted;
LogWebViewInitializationException(e);
}
}

private async void OnCoreWebView2InitializationCompleted(object sender,
CoreWebView2InitializationCompletedEventArgs e)
{
await WebView2.CoreWebView2.ClearServerCertificateErrorActionsAsync();
WebView2.CoreWebView2.ServerCertificateErrorDetected += OnServerCertificateErrorDetected;
try
{
if (e is not null && e.IsSuccess)
{
await WebView2.CoreWebView2.ClearServerCertificateErrorActionsAsync();
WebView2.CoreWebView2.ServerCertificateErrorDetected += OnServerCertificateErrorDetected;
}
else
{
LogWebViewInitializationException(e?.InitializationException);
}
}
catch (Exception ex)
{
_logger.Error<AppLog>("Failed to initialize CoreWebView2 server certificate handler.", ex);
}
}

private void LogWebViewInitializationException(Exception e)
{
_logger.Error<AppLog>("Failed to initialize CoreWebView2.", e);
}

private void OnServerCertificateErrorDetected(object sender,
CoreWebView2ServerCertificateErrorDetectedEventArgs e)
{
e.Action = IsCertificateValid(e)
? CoreWebView2ServerCertificateErrorAction.AlwaysAllow
: CoreWebView2ServerCertificateErrorAction.Cancel;
try
{
e.Action = IsCertificateValid(e)
? CoreWebView2ServerCertificateErrorAction.AlwaysAllow
: CoreWebView2ServerCertificateErrorAction.Cancel;
}
catch (Exception ex)
{
_logger.Error<AppLog>("Failed to validate server certificate in a WebView.", ex);
}
}

private bool IsCertificateValid(CoreWebView2ServerCertificateErrorDetectedEventArgs e)
Expand Down
122 changes: 87 additions & 35 deletions src/ProtonVPN.App/About/LicenseModalViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,93 @@
using System;
using System.IO;
using ProtonVPN.Common.Extensions;
using ProtonVPN.Common.Logging;
using ProtonVPN.Common.Logging.Categorization.Events.AppLogs;
using ProtonVPN.Modals;
using ProtonVPN.Modals;

namespace ProtonVPN.About
{
public class LicenseModalViewModel : BaseModalViewModel
{
private readonly ILogger _logger;
private const string LicenseFile = "COPYING.md";

public LicenseModalViewModel(ILogger logger)
{
_logger = logger;
}

public string License { get; set; }

protected override void OnInitialize()
{
base.OnInitialize();

LoadLicense();
}

private void LoadLicense()
{
try
{
License = File.ReadAllText(LicenseFile);
}
catch (Exception e) when (e.IsFileAccessException())
{
_logger.Error<AppFileAccessFailedLog>($"Error when reading license file '{LicenseFile}'.", e);
}
}
public string License { get; } = @"## Copying
Copyright(c) 2022 Proton Technologies AG
Proton VPN is free software: you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Proton VPN is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY;
without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Proton VPN. If not, see [https://www.gnu.org/licenses](https://www.gnu.org/licenses/).
## Dependencies
Proton VPN Windows app includes the following libraries:
* [ProtonMail SRP library](https://github.com/ProtonMail/go-srp) by Proton Technologies AG
| [The MIT License](https://github.com/ProtonMail/go-srp/blob/master/LICENSE.txt).
Proton VPN Windows app includes the following 3rd party software:
* [OpenVPN client](https://github.com/OpenVPN/openvpn) by OpenVPN Inc.
| [The GPL v2](https://github.com/OpenVPN/openvpn/blob/master/COPYRIGHT.GPL)
* [OpenVPN TAP - Windows adapter](https://github.com/OpenVPN/tap-windows6) by OpenVPN Technologies, Inc., Alon Bar-Lev
| [The GPL v2](https://github.com/OpenVPN/tap-windows6/blob/master/COPYRIGHT.GPL)
* [Autofac](https://autofac.org/) by Autofac Contributors
| [The MIT License](https://licenses.nuget.org/MIT).
* [Albireo.Base32](https://github.com/kappa7194/base32) by Albireo
| [The MIT License](https://github.com/kappa7194/base32/blob/master/LICENSE.txt).
* [ARSoft.Tools.Net](https://github.com/alexreinert/ARSoft.Tools.Net) By Alexander Reinert
| [Apache License 2.0](https://github.com/alexreinert/ARSoft.Tools.Net/blob/master/LICENSE)
* [ByteSize](https://github.com/omar/ByteSize) by Omar Khudeira
| [The MIT License](https://raw.githubusercontent.com/omar/ByteSize/master/LICENSE).
* [CalcBinding](https://github.com/Alex141/CalcBinding) by Alexander Zinchenko
| [Apache License 2.0](https://www.nuget.org/packages/CalcBinding/2.5.2/license).
* [Caliburn.Micro](https://caliburnmicro.com/) by Rob Eisenberg, Marco Amendola,
Chin Bae, Ryan Cromwell, Nigel Sampson, Thomas Ibel, Matt Hidinger
| [The MIT License](https://raw.githubusercontent.com/Caliburn-Micro/Caliburn.Micro/master/License.txt).
* [Caliburn.Micro.Core](https://caliburnmicro.com/) by Rob Eisenberg, Marco Amendola,
Chin Bae, Ryan Cromwell, Nigel Sampson, Thomas Ibel, Matt Hidinger
| [The MIT License](https://raw.githubusercontent.com/Caliburn-Micro/Caliburn.Micro/master/License.txt).
* [DeviceId](https://github.com/MatthewKing/DeviceId) by Matthew King
| [The MIT License](https://github.com/MatthewKing/DeviceId/blob/main/license.txt).
* [DnsClient](http://dnsclient.michaco.net/) by MichaCo
| [Apache License 2.0](https://github.com/MichaCo/DnsClient.NET/blob/master/LICENSE).
* [DynamicExpresso.Core](https://github.com/davideicardi/DynamicExpresso) by Davide Icardi
| [The MIT License](https://github.com/davideicardi/DynamicExpresso/blob/master/LICENSE).
* [MvvmLightLibsStd10](https://github.com/lbugnion/mvvmlight) by Laurent Bugnion (GalaSoft)
| [The MIT License](https://github.com/lbugnion/mvvmlight/blob/master/LICENSE).
* [Newtonsoft.Json](https://www.newtonsoft.com/json) by James Newton-King
| [The MIT License](https://licenses.nuget.org/MIT).
* [Apache log4net](https://logging.apache.org/log4net/) by The Apache Software Foundation
| [Apache License 2.0](https://logging.apache.org/log4net/license.html).
* [OxyPlot.Core](https://github.com/oxyplot/oxyplot/) by Oystein Bjorke
| [The MIT License](https://raw.githubusercontent.com/oxyplot/oxyplot/master/LICENSE).
* [OxyPlot.Wpf](https://github.com/oxyplot/oxyplot/) by Oystein Bjorke
| [The MIT License](https://raw.githubusercontent.com/oxyplot/oxyplot/master/LICENSE).
* [PInvoke.Kernel32](https://github.com/AArnott/pinvoke) by Andrew Arnott
| [The MIT License](https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE).
* [PInvoke.Windows.Core](https://github.com/AArnott/pinvoke) by Andrew Arnott
| [The MIT License](https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE).
* [PInvoke.Windows.ShellScalingApi](https://github.com/AArnott/pinvoke) by Andrew Arnott
| [The MIT License](https://raw.githubusercontent.com/AArnott/pinvoke/cf0176c42b/LICENSE).
* [Polly](https://github.com/App-vNext/Polly) by Michael Wolfenden, App vNext
| [The 3 - Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).
* [Polly.Contrib.WaitAndRetry](https://github.com/Polly-Contrib/Polly.Contrib.WaitAndRetry) by Grant Dickinson
| [The 3 - Clause BSD License](https://opensource.org/licenses/BSD-3-Clause).
* [PluralNet](https://github.com/rudyhuyn/PluralNet) by Rudy Huyn
| [The MIT License](https://github.com/rudyhuyn/PluralNet/blob/master/LICENSE).
* [Sentry](https://sentry.io) by Sentry Team and Contributors
| [The MIT License](https://raw.githubusercontent.com/getsentry/sentry-dotnet/master/LICENSE).
* [Sentry.PlatformAbstractions](https://sentry.io) by Sentry Team and Contributors
| [The MIT License](https://github.com/getsentry/sentry-dotnet-platform-abstractions/blob/master/LICENSE).
* [Sentry.Protocol](https://sentry.io) by Sentry Team and Contributors
| [The MIT License](https://raw.githubusercontent.com/getsentry/sentry-dotnet-protocol/master/LICENSE).
* [System.Buffers](https://dot.net) by Microsoft
| [The MIT License](https://github.com/dotnet/corefx/blob/master/LICENSE.TXT).
* [System.Collections.Immutable](https://dot.net) by Microsoft
| [The MIT License](https://github.com/dotnet/corefx/blob/master/LICENSE.TXT).";
}
}
}
Loading

0 comments on commit b62859a

Please sign in to comment.