Taal

NetworkSecurityConfig.CreateBaseConfig(Context) Method

Definition

Returns a base NetworkSecurityConfig using the provided app's defaults.

[Android.Runtime.Register("createBaseConfig", "(Landroid/content/Context;)Landroid/security/net/config/NetworkSecurityConfig;", "", ApiSince=37)]
public static Android.Security.Net.Config.NetworkSecurityConfig? CreateBaseConfig(Android.Content.Context context);
[<Android.Runtime.Register("createBaseConfig", "(Landroid/content/Context;)Landroid/security/net/config/NetworkSecurityConfig;", "", ApiSince=37)>]
static member CreateBaseConfig : Android.Content.Context -> Android.Security.Net.Config.NetworkSecurityConfig

Parameters

context
Context

of the application. Must not be null.

Returns

the application NetworkSecurityConfig, or null if the config cannot be found.

Attributes

Remarks

Returns a base NetworkSecurityConfig using the provided app's defaults.

An app default configuration has the following properties: If the application targets API level 27 (Android O MR1) or lower, cleartext traffic is allowed by default; Cleartext traffic is not permitted for ephemeral apps; No certificate pinning is used; The system certificate store is trusted for connections; If the application targets API level 23 (Android M) or lower than the user certificate store is trusted by default as well for non-privileged applications; Privileged applications do not trust the user certificate store on Android P and higher.

Android reference for android.security.net.config.NetworkSecurityConfig.createBaseConfig.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to