[PR #2629] [CLOSED] [PM-3089] mTLS - Authenticate with Client Certificate #9835

Closed
opened 2026-04-11 02:29:57 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2629
Author: @oguzhane
Created: 7/19/2023
Status: Closed

Base: mainHead: master


📝 Commits (10+)

  • 37897d6 functional mtls code
  • 36a6f9f prompt pksc12 cert
  • 20e7c5f fixes to import cert into keystore
  • e980007 code clean up
  • 1a13ecb i18n and UI improvements
  • d58806a support of importing cert chain
  • c34c1ea rename certificate chain spec
  • 35a4a93 support mTLS connection with cert chain
  • fb38fe0 reload client cert when changes
  • 48514f3 code cleanup & dummy ios services

📊 Changes

32 files changed (+980 additions, -78 deletions)

View changed files

📝 src/Android/Android.csproj (+15 -7)
📝 src/Android/MainActivity.cs (+25 -1)
📝 src/Android/MainApplication.cs (+3 -1)
src/Android/Security/AndroidHttpsClientHandler.cs (+76 -0)
src/Android/Security/X509CertificateChainSpec.cs (+42 -0)
src/Android/Services/CertificateService.cs (+256 -0)
📝 src/Android/Services/FileService.cs (+47 -5)
📝 src/App/App.csproj (+1 -0)
📝 src/App/Pages/Accounts/EnvironmentPage.xaml (+63 -0)
📝 src/App/Pages/Accounts/EnvironmentPageViewModel.cs (+107 -0)
📝 src/App/Pages/Accounts/LoginPage.xaml (+2 -0)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+10 -6)
📝 src/App/Pages/BaseViewModel.cs (+10 -1)
📝 src/App/Resources/AppResources.Designer.cs (+70 -4)
📝 src/App/Resources/AppResources.en-GB.resx (+18 -18)
📝 src/App/Resources/AppResources.resx (+22 -1)
📝 src/App/Styles/Base.xaml (+6 -0)
📝 src/Core/Abstractions/IApiService.cs (+2 -0)
src/Core/Abstractions/ICertificateService.cs (+17 -0)
📝 src/Core/Abstractions/IEnvironmentService.cs (+3 -0)

...and 12 more files

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

This PR brings ability to login a bitwarden server by using a client certificate. The functionility has been implemented for Android.
User can import a X509 client certificate in pkcs#12 format to KeyStore or user can use existing certificates from keychain.

See: #582

Code changes

CertificateService.cs: responsible to interact with platform's native key management apis.
AdvancedPage.xaml: page where user setup the certificate.
AndroidHttpsHandler.cs: http handler that send the requests with client certificate

Screenshots

Demo

https://github.com/bitwarden/mobile/assets/4419532/a100dfc5-abfa-481b-b4fb-fe8cff1f67ed

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/2629 **Author:** [@oguzhane](https://github.com/oguzhane) **Created:** 7/19/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `master` --- ### 📝 Commits (10+) - [`37897d6`](https://github.com/bitwarden/android/commit/37897d696bb418abfca4de13cfef12b01ac77ae7) functional mtls code - [`36a6f9f`](https://github.com/bitwarden/android/commit/36a6f9f36e1ae3cc00ad88568c787e8e31af6e66) prompt pksc12 cert - [`20e7c5f`](https://github.com/bitwarden/android/commit/20e7c5fcabe89cda718ae1530c406d70124af638) fixes to import cert into keystore - [`e980007`](https://github.com/bitwarden/android/commit/e980007e80fcf4f7b45efc6e3fdf1de9f1b7acb8) code clean up - [`1a13ecb`](https://github.com/bitwarden/android/commit/1a13ecb6b04d1ae597b25a82abb284de1f92a3bb) i18n and UI improvements - [`d58806a`](https://github.com/bitwarden/android/commit/d58806ac1a33334f47265b5d5538f3b5416de3c6) support of importing cert chain - [`c34c1ea`](https://github.com/bitwarden/android/commit/c34c1ead9b9d5ee1bcd35192e2e93eb3c74b597d) rename certificate chain spec - [`35a4a93`](https://github.com/bitwarden/android/commit/35a4a93e73c121cfbbd39442e637e63c53aafde0) support mTLS connection with cert chain - [`fb38fe0`](https://github.com/bitwarden/android/commit/fb38fe0af6ade1369a66e5f6906812ad59e68dd6) reload client cert when changes - [`48514f3`](https://github.com/bitwarden/android/commit/48514f3f7914a1bafec1f8838353c1a27cdaaaf5) code cleanup & dummy ios services ### 📊 Changes **32 files changed** (+980 additions, -78 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Android.csproj` (+15 -7) 📝 `src/Android/MainActivity.cs` (+25 -1) 📝 `src/Android/MainApplication.cs` (+3 -1) ➕ `src/Android/Security/AndroidHttpsClientHandler.cs` (+76 -0) ➕ `src/Android/Security/X509CertificateChainSpec.cs` (+42 -0) ➕ `src/Android/Services/CertificateService.cs` (+256 -0) 📝 `src/Android/Services/FileService.cs` (+47 -5) 📝 `src/App/App.csproj` (+1 -0) 📝 `src/App/Pages/Accounts/EnvironmentPage.xaml` (+63 -0) 📝 `src/App/Pages/Accounts/EnvironmentPageViewModel.cs` (+107 -0) 📝 `src/App/Pages/Accounts/LoginPage.xaml` (+2 -0) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+10 -6) 📝 `src/App/Pages/BaseViewModel.cs` (+10 -1) 📝 `src/App/Resources/AppResources.Designer.cs` (+70 -4) 📝 `src/App/Resources/AppResources.en-GB.resx` (+18 -18) 📝 `src/App/Resources/AppResources.resx` (+22 -1) 📝 `src/App/Styles/Base.xaml` (+6 -0) 📝 `src/Core/Abstractions/IApiService.cs` (+2 -0) ➕ `src/Core/Abstractions/ICertificateService.cs` (+17 -0) 📝 `src/Core/Abstractions/IEnvironmentService.cs` (+3 -0) _...and 12 more files_ </details> ### 📄 Description ## Type of change - [ ] Bug fix - [x] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective This PR brings ability to login a bitwarden server by using a client certificate. The functionility has been implemented for Android. User can import a X509 client certificate in pkcs#12 format to KeyStore or user can use existing certificates from keychain. See: #582 ## Code changes **CertificateService.cs**: responsible to interact with platform's native key management apis. **AdvancedPage.xaml**: page where user setup the certificate. **AndroidHttpsHandler.cs**: http handler that send the requests with client certificate ## Screenshots Demo https://github.com/bitwarden/mobile/assets/4419532/a100dfc5-abfa-481b-b4fb-fe8cff1f67ed ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-11 02:29:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#9835