Implement Brave VPN on Desktop
See original GitHub issueTest plan (and issues)
Test cases capture the issues that they fix in each section
Marked as release-notes/exclude since this is still behind a flag (defaulted to off); we’ll need to change that behavior to make the feature customer facing.
Related resources
- Figma https://www.figma.com/file/qtMYwoj3JWJO5xzwLt6j2f/Desktop-VPN
- Security review https://github.com/brave/security/issues/772 (has link to spec)
Steps to enable the VPN functionality (do on fresh profile before testing)
This is a pre-requisite step; this has to be done before any tests are attempted.
- VPN is only implemented for Windows and macOS (Linux captured in a VPN part 2 issue here).
- As of this writing, VPN is still behind a feature flag and is only enabled on BETA and NIGHTLY.
- Fresh profile (or not; depending on the test case)
- Set
brave://flags/#skus-sdkto ENABLED - Set
brave://flags/#brave-vpnto ENABLED - Set
brave://flags/#skus-environmentto DEVELOPMENT - Close the browser and re-open it
- Verify VPN is enabled (look for VPN button next to hamburger menu)
VPN button and entry in hamburger menu
- Add stub brave vpn button to toolbar
- Add Brave VPN to hamburger menu
- Add vpn button toggle option in settings
- VPN should have a right click to hide
- Debug crash when changing theme color (due to VPN button)
- VPN button text should be theme/contrast-aware
Verify the button is visible
- You should see a
VPNbutton (next to hamburger button) - You should also see a
Brave VPNentry in hamburger menu
Context menu behavior
- If you right click VPN button you should get a context menu
- Choose
Hide VPN button from toolbarfrom the context menu and verify the button is hidden - Go into hamburger menu, pick
Brave VPN, and chooseShow VPN button in toolbar. Verify button shows again - Go into hamburger menu, pick
Brave VPN, and chooseHide VPN button in toolbar. Verify button is hidden - Go into hamburger menu, pick
Brave VPN, and chooseShow VPN button in toolbar
Theming behavior
- Visit brave://settings/manageProfile
- Change your theme color to orange colors (like the Brave lion!)
- Verify Brave doesn’t crash 😄
- Verify that the VPN button adjusts its colors accordingly
- Change your theme back to the default
Brave Premium login
- Stripe session/checkout error trying to purchase VPN with experimental SKU SDK
- Detect and store VPN state after sign-in
Purchasing VPN with a new account
- Visit https://account.brave.software (Development) and sign into a new account
- Purchase VPN (browse plans, do checkout process; use a test credit card
4111 1111 1111 1111/12/24for example - or see https://stripe.com/docs/testing?numbers-or-method-or-token=card-numbers#visa) - Verify purchase works; you should be returned to account.brave.software
- VPN should show as purchased (you should NOT see
Complete your purchase to begin using Brave VPN) - Click the
Refresh Brave VPNbutton and you should see green text sayingYOU HAVE ACTIVE CREDENTIALS LOADED! - Click
VPNbutton (top right by hamburger) and you should see the on/off toggle and your default region
Login to an existing account which has VPN
- On a different profile than above (see
Purchasing VPN with a new account), visit https://account.brave.software (Development) and sign into the same account - VPN should show as purchased (you should NOT see
Complete your purchase to begin using Brave VPN) - Click the
Refresh Brave VPNbutton and you should see green text sayingYOU HAVE ACTIVE CREDENTIALS LOADED! - Click
VPNbutton (top right by hamburger) and you should see the on/off toggle and your default region - It could be handy to copy this folder and keep it handy as a “fresh logged in profile” (in tests below)
OS integration
- Notify more detailed VPN connecting status change on Windows
- BraveVPNOSConnectionAPI should detect OS’s vpn status
Toggle VPN in operating system (with Brave open)
- Have Brave open with VPN button visible
- Have a working connection (region doesn’t matter). Verify you can connect/disconnect in Brave.
- Keep Brave open and go to your OS’s VPN section.
- On Windows, you can push Windows key and type
VPN settingsto get there - macOS shows under
Settings>Networking
- On Windows, you can push Windows key and type
- Find the
BraveVPNconnection - Manually connect to the VPN using the OS interface
- Verify that Brave’s VPN button lights up Green when connected
- Verify that Brave’s VPN button shows as gray when not connected
Toggle VPN in operating system (with Brave closed)
- Have Brave open with VPN button visible
- Have a working connection (region doesn’t matter). Verify you can connect/disconnect in Brave.
- Close Brave
- Go to your OS’s VPN section.
- On Windows, you can push Windows key and type
VPN settingsto get there - macOS shows under
Settings>Networking
- On Windows, you can push Windows key and type
- Find the
BraveVPNconnection - Manually connect to the VPN using the OS interface
- In a different browser (Edge, Safari, Chrome) visit https://whatismyipaddress.com/
- Verify that you’re in the appropriate region (where you connected manually in step 2)
Visible user interface
- VPN panel (logged in to Brave Premium)
- VPN panel (NOT logged in to Brave Premium)
- VPN panel (login expires)
- VPN Panel - create a basic server selection UI w/o service logic
- Handle not having permission to write config (macOS)
- Determine default vpn region based on user’s timezone or country code
- [Desktop VPN] Add region flag icons to vpn region list
- Add sending email form for VPN Support
Notes before testing
Please refer to the Figma as you test: https://www.figma.com/file/qtMYwoj3JWJO5xzwLt6j2f/Desktop-VPN
This should be accurate and captures expected look and feel for both light and dark mode (we’ll want to test both).
Purchase entry points
This would be on a fresh profile after enabling the VPN feature
- Click the VPN button (top right, next to hamburger button)
- Panel will show up and have the sales information (Buy / Already purchased?).
- Interact (verify links go to the right place, etc)
- Click the VPN button again to hide the panel
- Click
Brave VPNin the hamburger menu - Verify the sale panel shows up
Post-purchase UX
Default region selection
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Click the VPN button (top right, next to hamburger button)
- You should see a default region picked which is nearest to your location (based on time zone)
- Set your OS time to be in another region (like Japan)
- Create another fresh profile and get setup with VPN
- Click VPN button
- Verify it shows region close to where you picked (ex: Japan)
Verify connecting works and connected/unconnected state shows properly
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Click the VPN button (top right, next to hamburger button)
- Enable VPN
- Verify that Brave’s VPN button lights up Green when connected
- Visit https://whatismyipaddress.com/
- The website should show you as being in the VPN region now 🎉
- Check hamburger menu >
Brave VPNand ensure toggle there shows as connected - Click the toggle (disconnect) in hamburger menu >
Brave VPN - Verify that Brave’s VPN button shows as gray when not connected
- Visit https://whatismyipaddress.com/
- You should be back in your regular region now
macOS - Handle no permission to write config
- Fresh profile; enable Brave VPN / SKU
- Go to
Settings>Networkingand remove any occurrences ofBrave VPN - Connect to VPN
- You should be presented with the dialog from https://github.com/brave/brave-browser/issues/22109
- Click
Don't allow - You should see a warning like the one under
Error message - VPN Connection not allowedin Figma
Verify you can change regions
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Click the VPN button (top right, next to hamburger button)
- You should see the default region with a
>arrow. Click that to show regions - Region list should show. The choices listed are coming from Guardian VPN.
- Choose a different region and connect
- Verify you can connect; confirm you’re in that region using https://whatismyipaddress.com/
- Disconnect from VPN
- Choose a different region and connect
- Verify connect works; confirm you’re in that region using https://whatismyipaddress.com/
- Without disconnecting, choose a different region and connect
- Verify that VPN disconnects and reconnects; confirm you’re in that region using https://whatismyipaddress.com/
Setttings
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Click the VPN button (top right, next to hamburger button)
- Click the gear button to go into Settings
- Verify navigation works (ex: you can go back; clicking
Contact technical supportopens a new screen; you can go back from that)
Creating a support ticket
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Click the VPN button (top right, next to hamburger button)
- Click the gear button to go into Settings
- Click
Contact technical support - Fill out the support form. Feel free to try to break it 😄 Provide an email you have access to read
- Submit form when ready
- Check with a Guardian team member to confirm if ticket was received
Edge cases and error states
Can’t connect to server UI
- Complete the steps under
Brave Premium login>Login to an existing account which has VPN - Unplug your network cable (or disable WiFi)
- Click the VPN button (top right, next to hamburger button)
- Click the toggle to enable
- You should see the error about not being able to connect
- Plug network cable back in OR enable WiFi (disabled in step 2)
- Click the
Try againbutton - It should work now
Preferences
- Visit brave://settings/appearance
- Verify there is a setting
Show VPN button - Test it out; toggling should show and hide the button next to hamburger menu
Original issue description
Overall goal is to implement a VPN manager within Brave that can create connection, connect, disconnect, and remove a connection. The connection will show in the OS’s VPN area for OSes that support that
- Backend integration (TBD - authenticating purchase, etc)
- Windows https://github.com/brave/brave-browser/issues/15805
- macOS https://github.com/brave/brave-browser/issues/15810
History (pathfinding, proof of concept info, etc) available in the employee only issue: https://github.com/brave/internal/issues/729
Android is currently a WIP which is tracked with https://github.com/brave/brave-browser/issues/12197 and https://github.com/brave/brave-browser/issues/14048 - development done by @deeppandya
iOS is already live; please see https://github.com/brave/brave-ios/issues/2739 along with https://github.com/brave/brave-ios/pulls?q=is%3Apr+VPN+is%3Aclosed+sort%3Aupdated-desc
Subtasks not covered in test plan
- Makes VPN Service fetch/cache region list
- Add state machine to vpn service
- Load VPN urls from app menu
- Pass vpn urls to webui via mojo
- Add purchased state in brave_vpn.mojom and manage it in service
- Fetch hostnames for selected vpn region and cache it in service
- Store fetched region list/device region in prefs and update it periodically in background
- Wiring up BraveVPNService with BraveVPNOSConnectionAPI
- Create vpn panel handler for webui to call and interface it with mojom
- Add mojo observer to vpn desktop service
- Get all regions in desktop vpn service and expose to mojom
- Get region list from the desktop service to webui
- Add vpn lifecycle events to webui
- Add gradient animation
- Add “not allowed state” to connection state
- VPN Panel WebUI should be chrome-untrusted
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:9 (3 by maintainers)

Top Related StackOverflow Question
Verification
PASSEDusingBuilds:
1.39.89&1.39.100OS/arch:
macOS-x64/Intel 11.6.5 (Big Sur)NOTE: the VPN flag isn’t available in
release-channel builds, so VPN was not testable using the RC:SKU flagsno VPN flagNOTE: It will be tested heavily again in 1.40.x, and an issue tracking remaining verification work will be created, post-release of 1.39.x
Initial Setup
Shared VPN-Setup Steps - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCBConfirmed I was able to purchase and use a Brave VPN subscription, from end-to-end, defaulting to USA (West):
Suggested: also set
Show VPN status in menu barviaApple->System Preferences->NetworkforBraveVPN:Between-test cleanup
BraveVPN OS-config removal - PASSED
In-between clean-profile tests, you should remove the
BraveVPNconfig in yourApple->System Preferences->Networkpanel. No restart necessary.UI
Theme support - PASSED
brave://settings/manageProfileDark & Light Brave colors support - PASSED
brave://settings/appearanceLight, switch toDark)DarkLightbrave://settings/appearance - PASSED
VPN button
brave://settings/appearanceShow VPN buttonis toggled toONby defaultOFFVPNbutton disappears from the toolbar in real-timeONVPN button and dialog links - PASSED
brave://settings/appearance- seeSettingssection, belowhttps://support.brave.com/hc/en-ushttps://brave.com/firewall-vpn/https://account.brave.software/Hide VPN button1Hide VPN button2Send FeedbackAbout Brave VPNManage my planHamburger flyout menu - PASSED
Click on the “hamburger” menu icon on the browser toolbar
Brave VPNtoggle,ConnectedBrave VPNtoggle,DisconnectedHide VPN button in toolbar, 1Hide VPN button in toolbar, 2Send feedbackAbout Brave VPNManage my planVPN-button settings dialog - FAILED
Manage subscriptionContact technical supportAbout Brave Firewall + VPNLogged:
Brave Premium login
Purchasing VPN with a new account - PASSED
Steps:
Followed steps from
Shared VPN-Setup Steps, and verified above.Log in to an existing account which has VPN - PASSED
Steps:
1.39.xSKUflags and theVPNflag onbrave://flagsRelaunchbuttonaccount.brave.softwareGet login linkaccount.brave.software/account, which showed my activeBrave VPN SubscriptionunderYour plan subscriptionsRefresh Brave VPNbuttonYOU HAVE ACTIVE CREDENTIALS LOADED!banner appeared above the VPN entryVPNbutton on the toolbarDISCONNECTEDtoCONNECTEDAllowwhen prompted to configure the VPN config in macOSVPNbutton, and confirmed I was connected toUSA (West)Post-purchase UX
Default region selection - PASSED
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)Japan)VPNbuttonJapan)default regionJapan,Standard Timenew VPN profileauto-detected regionIP/location detailsConnecting/disconnecting - PASSED*
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)https://www.ip2location.com/demohamburger menu>Brave VPNand ensure toggle there shows asconnecteddisconnect) inhamburger menu>Brave VPNhttps://www.ip2location.com/demoNOTE: this test is good, but basic, and connecting/reconnecting issues will (still) be further tested after this verification.
For bonus points/extra credit/gold star ⭐ , alternate the above
Brave VPNconnection-toggle method with:Networkcontrol panel inSystem PreferencesLogged:
Changing regions - PASSED
Brave Premium login > Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)whatismyipaddress.comwhatismyipaddress.comwhatismyipaddress.comOS integration/connectivity
Toggle VPN in operating system (with Brave open) - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, and then:Applemenu ->System Preferences->NetworkBraveVPNconnectionConnectVPNbutton icon lights up green in the toolbarToggle VPN in operating system (with Brave closed) - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, and then:Applemenu ->System Preferences->NetworkBraveVPNconnectionConnectip2location.com/demousing Firefox (or Chrome, Safari, or Edge…)Creating a support ticket - PASSED
Verified in
https://github.com/brave/brave-browser/issues/18469#issuecomment-1112771226Logged:
Edge cases and error states
Cancel plan - FAILED
(UI unimplemented)
Logged:
Edit payment - FAILED
(UI unimplemented)
Logged:
Expired credit card / credentials - FAILED
Brave Premium login>Purchasing VPN with a new account, making sure to specify the current month and year for the credit card’s expiration dateBrave VPNaccountDate & TimeinSystem Preferencesand advance the OS date to the1stof next monthBrave VPNEdit your paymentdialogcard detailssystem clockVPN-button dialogLogged:
Can’t connect to server UI - FAILED
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)ENABLETry againbuttonLogged:
Limit of 5 VPN-connected devices/profile, on the same account (email address) - FAILED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, using the same email address for each. Ensure you can use each VPN instance successfully (and concurrently) for devices/profiles 1-5.Logged:
Security & privacy
DNS leak (ISP) - PASSED
https://browserleaks.com/dnshttps://browserleaks.com/dnsKnown issues:
DNS-over-HTTP (DoH) - PASSED
DNS over HTTPusing any provider, viabrave://settings/securitybrowserleaks.com/dnsbrave://settings/securitybrowserleaks.com/dnsTOR - PASSED
New Private window with Torcheck.torproject.orgCongratulations. This browser is configured to use TorTorrent (via
WebTorrents support) - PASSEDShared VPN-Setup StepssectionBraveVPNhttps://ipleak.net/ActivateunderTorrent Address detectionthis Magnet Link(it’ll open in a new window)Start Torrenthttps://ipleak.net/tabBraveVPNvia your preferred method (flyout menu, button toggle, macOS system bar (top), andNetworkcontrol panel inSystem Preferences)shift+reloadthe page (to purge cache) <------ IMPORTANTstep 9-AT&T ISPstep 13-USA (West)step 14-SwitzerlandWebRTC - PASSED
BraveVPNhttps://browserleaks.com/webrtcWebRTC IP handling policyVPN connectedDefaultDefault public and private interfacesDefault public interface onlyDisable non-proxied UDPDisconnected from VPNDefaultDefault public and private interfacesDefault public interface onlyDisable non-proxied UDPKeyboard accessibility - FAILED
VPNbutton on the browser toolbarSettings(gear) icontabto forward-cycle through elementsshift+tabto backwards-cycle through the dialog linksspacebarandreturnto select (“click”) linksLogged:
Issues encountered while testing:
Verification PASSED on
Encountered and logged the following issues:
VPN status doesn’t show the connected state when brave is auto-upgraded #23080 VPN can’t be reconnected in the same session when internet/wifi is disconnected and reconnected #23081
Initial Setup
Shared VPN-Setup Steps - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCBConfirmed I was able to purchase and use a Brave VPN subscription, from end-to-end, defaulting to USA (East):
Suggested: also set
Show VPN status in menu barvia Manage Notifications->Settings->BraveVPNBetween-test cleanup
BraveVPN OS-config removal - PASSED
In-between clean-profile tests, you should remove the Manage Notifications->Settings->BraveVPN
UI
Theme support - PASSED
brave://settings/manageProfileDark & Light Brave colors support - PASSED
brave://settings/appearanceLight, switch toDark)DarkLightbrave://settings/appearance - PASSED
VPN button
brave://settings/appearanceShow VPN buttonis toggled toONby defaultOFFVPNbutton disappears from the toolbar in real-timeONVPN button and dialog links - PASSED
brave://settings/appearance- seeSettingssection, belowhttps://support.brave.com/hc/en-ushttps://brave.com/firewall-vpn/https://account.brave.software/Hide VPN button1Hide VPN button2Send FeedbackAbout Brave VPNManage my planHamburger flyout menu - PASSED
Click on the “hamburger” menu icon on the browser toolbar
Brave VPNtoggle,ConnectedBrave VPNtoggle,DisconnectedHide VPN button in toolbar, 1Hide VPN button in toolbar, 2Send feedbackAbout Brave VPNManage my planVPN-button settings dialog - FAILED
Encountered https://github.com/brave/brave-browser/issues/22694 Encountered https://github.com/brave/brave-browser/issues/22695
Contact technical support
Brave Premium login
Purchasing VPN with a new account - PASSED
Steps:
Followed steps from
Shared VPN-Setup Steps, and verified above.Log in to an existing account which has VPN - PASSED
Steps:
1.39.xSKUflags and theVPNflag onbrave://flagsRelaunchbuttonaccount.brave.softwareGet login linkaccount.brave.software/account, which showed my activeBrave VPN SubscriptionunderYour plan subscriptionsRefresh Brave VPNbuttonYOU HAVE ACTIVE CREDENTIALS LOADED!banner appeared above the VPN entryVPNbutton on the toolbarDISCONNECTEDtoCONNECTEDAllowwhen prompted to configure the VPN config in macOSVPNbutton, and confirmed I was connected toUSA (West)Post-purchase UX
Default region selection - PASSED
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)Japan)VPNbuttonJapan)US regionIP/location detailsautodetected region US (East)IN regionIP/location detailsautodetected region SingaporeConnecting/disconnecting - PASSED*
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)https://www.ip2location.com/demohamburger menu>Brave VPNand ensure toggle there shows asconnecteddisconnect) inhamburger menu>Brave VPNhttps://www.ip2location.com/demoNOTE: this test is good, but basic, and connecting/reconnecting issues will (still) be further tested after this verification.
For bonus points/extra credit/gold star ⭐ , alternate the above
Brave VPNconnection-toggle method with:Networkcontrol panel inSystem PreferencesEncountered:
Changing regions - PASSED
Brave Premium login > Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)whatismyipaddress.comwhatismyipaddress.comwhatismyipaddress.comOS integration/connectivity
Toggle VPN in operating system (with Brave open) - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, and then:Applemenu ->System Preferences->NetworkBraveVPNconnectionConnectVPNbutton icon lights up green in the toolbarToggle VPN in operating system (with Brave closed) - PASSED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, and then:Applemenu ->System Preferences->NetworkBraveVPNconnectionConnectip2location.com/demousing Firefox (or Chrome, Safari, or Edge…)Creating a support ticket - PASSED
Verified in
https://github.com/brave/brave-browser/issues/18469#issuecomment-1112771226Encountered:
Edge cases and error states
Cancel plan - FAILED
(UI unimplemented)
Encountered:
Edit payment - FAILED
(UI unimplemented)
Encountered:
Expired credit card / credentials - FAILED
Brave Premium login>Purchasing VPN with a new account, making sure to specify the current month and year for the credit card’s expiration dateBrave VPNaccountDate & TimeinSystem Preferencesand advance the OS date to the1stof next monthBrave VPNEdit your paymentdialogcard detailssystem clockVPN-button dialogEncountered:
Can’t connect to server UI - FAILED
Brave Premium login>Login to an existing account which has VPNVPNbutton (top right, next to hamburger button)ENABLETry againbuttonEncountered:
Limit of 5 VPN-connected devices/profile, on the same account (email address) - FAILED
Follow steps from
https://bravesoftware.slack.com/archives/CC5SA8CCB/p1651597201141019?thread_ts=1651597077.189229&cid=CC5SA8CCB, using the same email address for each. Ensure you can use each VPN instance successfully (and concurrently) for devices/profiles 1-5.Encounter:
Security & privacy
DNS leak (ISP) - PASSED
https://browserleaks.com/dnshttps://browserleaks.com/dnsKnown issues:
DNS-over-HTTP (DoH) - PASSED
DNS over HTTPusing any provider, viabrave://settings/securitybrowserleaks.com/dnsbrave://settings/securitybrowserleaks.com/dnsTOR - PASSED
New Private window with Torcheck.torproject.orgCongratulations. This browser is configured to use TorTorrent (via
WebTorrents support) - PASSEDShared VPN-Setup StepssectionBraveVPNhttps://ipleak.net/ActivateunderTorrent Address detectionthis Magnet Link(it’ll open in a new window)Start Torrenthttps://ipleak.net/tabBraveVPNvia your preferred method (flyout menu, button toggle, macOS system bar (top), andNetworkcontrol panel inSystem Preferences)shift+reloadthe page (to purge cache) <------ IMPORTANTstep 9-AT&T ISPstep 13-Singapore)step 14-UKWebRTC - PASSED
BraveVPNhttps://browserleaks.com/webrtcWebRTC IP handling policyVPN connectedDefaultDefault public and private interfacesDefault public interface onlyDisable non-proxied UDPDisconnected from VPNDefaultDefault public and private interfacesDefault public interface onlyDisable non-proxied UDPKeyboard accessibility - FAILED
VPNbutton on the browser toolbarSettings(gear) icontabto forward-cycle through elementsshift+tabto backwards-cycle through the dialog linksspacebarandreturnto select (“click”) linksEncountered: