Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise en place certificate pinning #1

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does F-Droid version need to allow clear traffic on local network ? VPN need on NEO devices ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear text traffic can be used only for specific hosts during development :

  • localhost
  • 127.0.0.1
  • etc ...

It's the default configuration provided by Element X for all variants (Fdroid and Gplay). I move it for Fdroid only.

File renamed without changes.
Binary file added app/src/gplay/res/raw/certignaservicesrootca.cer
Binary file not shown.
27 changes: 27 additions & 0 deletions app/src/gplay/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<!-- Do not allow clearText traffic -->
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<!-- Do not allow system and user certificates by default -->

<!-- Allow only Tchap intermediate certificate authority -->
<certificates src="@raw/certignaservicesrootca" />
</trust-anchors>
</base-config>

<!-- Allow system certificates for firebase if used. No effect on FDroid variant -->
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="false">firebaseinstallations.googleapis.com</domain>
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</domain-config>

<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class VectorUncaughtExceptionHandler(
override fun uncaughtException(thread: Thread, throwable: Throwable) {
Timber.v("Uncaught exception: $throwable")
val bugDescription = buildString {
val appName = "ElementX"
val appName = "TchapX"
// append(appName + " Build : " + versionCodeProvider.getVersionCode() + "\n")
append("$appName Version : 1.0") // ${versionProvider.getVersion(longFormat = true)}\n")
// append("SDK Version : ${Matrix.getSdkVersion()}\n")
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dependencyResolutionManagement {

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

rootProject.name = "ElementX"
rootProject.name = "TchapX"
include(":app")
include(":appnav")
include(":appconfig")
Expand Down
Loading