Merge pull request #344 from cyb3rko/client-certificate-auth

Client certificate authentication (mTLS)
This commit is contained in:
Jannis Mattheis
2024-06-13 21:43:18 +02:00
committed by GitHub
15 changed files with 354 additions and 142 deletions

View File

@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp">
@@ -18,8 +20,47 @@
android:text="@string/select_ca_certificate" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/seleceted_ca_cert"
android:id="@+id/selected_ca_cert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/no_certificate_selected" />
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" />
<com.google.android.material.button.MaterialButton
android:id="@+id/toggle_client_cert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@android:color/white"
android:text="@string/select_client_certificate" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/selected_client_cert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/no_certificate_selected" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/client_cert_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:maxWidth="280dp"
android:ems="10">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/client_cert_password_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textPassword"
android:importantForAutofill="no"
android:hint="@string/client_cert_password" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>

View File

@@ -40,9 +40,15 @@
<string name="password">Password</string>
<string name="disabled_validate_ssl">Disable SSL Validation</string>
<string name="select_ca_certificate">Select CA Certificate</string>
<string name="select_ca_file">Select a Certificate File</string>
<string name="select_client_certificate">Select Client Certificate (PKCS#12)</string>
<string name="select_ca_file">Select a CA Certificate File</string>
<string name="select_client_file">Select a Client Certificate File</string>
<string name="client_cert_password">Certificate Password</string>
<string name="client_cert_password_missing">Password required</string>
<string name="please_install_file_browser">Please install a file browser</string>
<string name="select_ca_failed">Failed to read CA: %s</string>
<string name="select_ca_failed">Failed to read CA cert: %s</string>
<string name="select_client_failed">Failed to read client cert: %s</string>
<string name="certificate_found">Certificate found</string>
<string name="login">Login</string>
<string name="check_url">Check URL</string>
<string name="permissions_dialog_grant">Grant</string>
@@ -65,6 +71,7 @@
<string name="done">Done</string>
<string name="no_certificate_selected">No certificate selected</string>
<string name="remove_ca_certificate">Remove CA Certificate</string>
<string name="remove_client_certificate">Remove Client Certificate</string>
<string name="warning">Warning</string>
<string name="http_warning">Using HTTP is insecure and it\'s recommend to use HTTPS instead. Use your favorite search engine to get more information about this topic.</string>
<string name="i_understand">I Understand</string>