[VPN] Update server-status VPN API endpoint (#36627)

On Mac, we use a server-status endpoint for OnDemand VPN functionality.
The change upgrades the old (current) API `/vpnsrv/api/server-status`,
to the new one: `/api/v1.3/server-status`. The API responses are
claimed by Guardian to be identical, zero behavioural change.
This commit is contained in:
Alex
2026-05-21 20:41:23 -04:00
committed by GitHub
parent 6860dfbbd4
commit 29e1edc7e4
2 changed files with 7 additions and 4 deletions
@@ -19,6 +19,7 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "brave/components/brave_vpn/browser/connection/brave_vpn_connection_manager.h"
#include "brave/components/brave_vpn/common/brave_vpn_constants.h"
#include "brave/components/brave_vpn/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -215,10 +216,11 @@ void IKEv2ConnectionAPIImplMac::CreateVPNConnectionImpl(
vpn_server_connect_rule.interfaceTypeMatch =
NEOnDemandRuleInterfaceTypeAny;
vpn_server_connect_rule.probeURL = [NSURL
URLWithString:
[NSString
stringWithFormat:@"https://%@/vpnsrv/api/server-status",
base::SysUTF8ToNSString(info.hostname())]];
URLWithString:[NSString stringWithFormat:@"https://%@/%@",
base::SysUTF8ToNSString(
info.hostname()),
base::SysUTF8ToNSString(
kServerStatus)]];
[vpn_manager setOnDemandRules:@[ vpn_server_connect_rule ]];
}
@@ -53,6 +53,7 @@ inline constexpr char kCredential[] = "api/v1.3/device/";
inline constexpr char kVerifyPurchaseToken[] = "api/v1.1/verify-purchase-token";
inline constexpr char kCreateSubscriberCredentialV12[] =
"api/v1.2/subscriber-credential/create";
inline constexpr char kServerStatus[] = "api/v1.3/server-status";
inline constexpr int kP3AIntervalHours = 24;
inline constexpr char kSubscriberCredentialKey[] = "credential";