A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release anziché aosp-main per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per i dispositivi con Android 13 o versioni successive, Android supporta l'approccio di autenticazione Trust on First Use (TOFU) (RFC7435), che consente agli utenti di considerare attendibile una rete aziendale (EAP) installando la CA radice utilizzata dal server e impostando il relativo nome di dominio in una rete salvata. TOFU consente al dispositivo di ottenere una chiave pubblica non autenticata quando un utente si connette per la prima volta a una rete aziendale e di conservare la chiave per le connessioni successive.
Sfondo
Rispetto alle reti personali che richiedono solo una password, le reti aziendali
utilizzano l'autenticazione PKI (Public Key Infrastructure), che richiede al client
di preinstallare i certificati. In Android 11 o versioni precedenti, gli utenti possono selezionare l'opzione Non convalidare per il certificato CA del server nelle impostazioni di rete, bypassando la convalida del certificato lato server. Tuttavia, per rafforzare la sicurezza e rispettare la specifica WPA R2, Android 12 ha introdotto un requisito per le reti aziendali: la convalida del certificato del server. Questo requisito aggiuntivo ha creato una barriera per gli utenti, che devono installare un certificato CA per queste reti. TOFU consente agli utenti di connettersi a una rete aziendale basata su PKI semplicemente accettando la relativa CA radice.
Comportamento della funzionalità
I dispositivi che supportano TOFU mostrano il seguente comportamento quando un utente si connette
a una rete aziendale che non ha una chiave pubblica autenticata già installata.
Connettiti a una nuova rete tramite il selettore Wi-Fi
Seleziona una nuova rete aziendale nel selettore Wi-Fi.
Il dispositivo mostra una finestra di dialogo (Figura 1) per confermare se la rete è attendibile.
Tocca Sì, connetti per accettare la connessione alla rete oppure No, non connettere per rifiutarla.
Se tocchi Sì, connetti, il dispositivo configura automaticamente i parametri di sicurezza, si connette alla rete e attiva la connessione automatica per la rete.
Se tocchi No, non connettere, il dispositivo si scollegherà dalla rete e disattiva la connessione automatica per la rete.
Figura 1. Finestra di dialogo per la funzionalità TOFU
Connettiti alla rete esistente con il collegamento automatico abilitato
Quando si connette a una rete aziendale in cui è attiva la connessione automatica, ma non è presente un certificato CA valido, il dispositivo si connette automaticamente e poi visualizza una notifica fissa (non ignorabile).
Tocca la notifica.
Il dispositivo mostra una finestra di dialogo (Figura 1) per confermare se la rete è attendibile.
Tocca Sì, connetti per accettare la connessione alla rete oppure No, non connettere per rifiutarla.
Se tocchi Sì, connetti, il dispositivo configura automaticamente i parametri di sicurezza, si connette alla rete e attiva la connessione automatica per la rete.
Se tocchi No, non connettere, il dispositivo si scollegherà dalla rete e disattiva la connessione automatica per la rete.
Per convalidare l'implementazione del TOFU sul tuo dispositivo, utilizza i seguenti test:
CTS: CtsWifiTestCases
VTS: VtsHalWifiSupplicantStaNetworkTargetTest
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Trust on First Use (TOFU)\n\nFor devices running Android 13 or higher, Android\nsupports the Trust on First Use (TOFU) authentication approach\n([RFC7435](https://datatracker.ietf.org/doc/html/rfc7435.html)),\nwhich lets users trust an enterprise (EAP) network by installing the root CA\nused by the server and setting its domain name in a saved network. TOFU allows\nthe device to obtain an unauthenticated public key when a user first connects\nto an enterprise network and retain the key for subsequent connections.\n\nBackground\n----------\n\nCompared to personal networks that just require a password, enterprise networks\nuse public key infrastructure (PKI) authentication, which requires the client\nto preinstall certificates. In Android 11 or lower, users can select the\n*Do not validate* option for the server CA certificate in the network settings,\nbypassing the validation of the server side certificate. However, to strengthen\nsecurity and comply with the WPA R2 specification, Android 12 introduced a\nrequirement for enterprise networks to have server certificate validation. This\nadditional requirement created a barrier for users as they need to install a CA\ncertificate for such networks. TOFU provides a way for users to connect to a\nPKI-based enterprise network by simply accepting its root CA.\n\nFeature behavior\n----------------\n\nDevices that support TOFU display the following behavior when a user connects\nto an enterprise network that doesn't have an *already-installed*\nauthenticated public key.\n\n### Connect to new network through Wi-Fi picker\n\n1. Select a new enterprise network in Wi-Fi picker.\n\n The device displays a dialog (Figure 1) to confirm whether the\n network is trusted.\n2. Tap **Yes, connect** to accept the network connection, or tap **No, don't\n connect** to decline.\n\n - If you tap **Yes, connect**, the device automatically configures the\n security parameters, connects to the network, and enables autoconnect\n for the network.\n\n | **Note:** Misconfigured networks that use invalid or expired certificates might not allow any security validation by the device. In such cases, the device fails to connect to the network.\n - If you tap **No, don't connect**, the device disconnects from the\n network and disables autoconnect for the network.\n\n **Figure 1.** Dialog for the TOFU feature\n\n### Connect to existing network with autoconnect enabled\n\nWhen connecting to an enterprise network that has autoconnect enabled but\ndoesn't have a valid CA certificate, the device connects automatically, then\ndisplays a sticky (nondismissable) notification.\n\n1. Tap the notification.\n\n The device displays a dialog (Figure 1) to confirm whether the\n network is trusted.\n2. Tap **Yes, connect** to accept the network connection, or tap **No, don't\n connect** to decline.\n\n - If you tap **Yes, connect**, the device automatically configures the\n security parameters, connects to the network, and enables autoconnect\n for the network.\n\n | **Note:** Misconfigured networks that use invalid or expired certificates might not allow any security validation by the device. In such cases, the device fails to connect to the network.\n - If you tap **No, don't connect**, the device disconnects from the\n network and disables autoconnect for the network.\n\nImplementation\n--------------\n\nTo support the TOFU feature, implement the supplicant HALs provided in the\nAndroid Open Source Project (AOSP) at\n[`/hardware/interfaces/wifi/supplicant/aidl/android/hardware/wifi/supplicant`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/interfaces/wifi/supplicant/aidl/android/hardware/wifi/supplicant).\n\nThe following public APIs are available in Android 13\nfor use by apps:\n\n- [`WifiManager#isTrustOnFirstUseSupported()`](https://developer.android.com/reference/android/net/wifi/WifiManager#isTrustOnFirstUseSupported()): Indicates whether the device supports TOFU.\n- [`WifiEnterpriseConfig#enableTrustOnFirstUse(boolean)`](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#enableTrustOnFirstUse(boolean)): Enables TOFU.\n- [`WifiEnterpriseConfig#isTrustOnFirstUseEnabled()`](https://developer.android.com/reference/android/net/wifi/WifiEnterpriseConfig#isTrustOnFirstUseEnabled()): Indicates whether TOFU is enabled.\n\nValidation\n----------\n\nTo validate the implementation of TOFU on your device, use the following tests:\n\n- CTS: `CtsWifiTestCases`\n- VTS: `VtsHalWifiSupplicantStaNetworkTargetTest`"]]