title: Connect to Enterprise WPA2 wifi on Android 10+
body: <p>I'm trying to create a enterprise WPA2 connection on Flutter with Kotlin native code. I'm using the WifiSuggestion API as I want that the wifi keeps the connection even after the app closes. Here's the implementation:</p>
  <pre><code>            val enterpriseConfig = WifiEnterpriseConfig()
  
              enterpriseConfig.identity = uid
              enterpriseConfig.password = uPassword
              enterpriseConfig.eapMethod = WifiEnterpriseConfig.Eap.PEAP
              enterpriseConfig.phase2Method = WifiEnterpriseConfig.Phase2.MSCHAPV2
  
              val eduroamSuggestion = WifiNetworkSuggestion.Builder()
                      .setSsid(wifiSSID)
                      .setWpa2EnterpriseConfig(enterpriseConfig)
                      .build()
  </code></pre>
  <p>And I'm having the
  <strong>java.lang.IllegalArgumentException: Enterprise configuration is insecure</strong> error
  as on the stacktrace below</p>
  <pre><code>E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612): Failed to handle method call
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612): java.lang.IllegalArgumentException: Enterprise configuration is insecure
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at android.net.wifi.WifiNetworkSuggestion$Builder.setWpa2EnterpriseConfig(WifiNetworkSuggestion.java:271)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at br.uff.uffmobileplus.WifiHandler$Companion.assembleConnection(WifiHandler.kt:171)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at br.uff.uffmobileplus.MainActivity.configureFlutterEngine$lambda-0(MainActivity.kt:59)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at br.uff.uffmobileplus.MainActivity.lambda$1vo85UVy1PXOPIbKlJk84gSeKS4(Unknown Source:0)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at br.uff.uffmobileplus.-$$Lambda$MainActivity$1vo85UVy1PXOPIbKlJk84gSeKS4.onMethodCall(Unknown Source:2)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$AIEPqY6mWzaNK15HekX9bftoAXs.run(Unknown Source:12)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at android.os.Handler.handleCallback(Handler.java:938)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at android.os.Handler.dispatchMessage(Handler.java:99)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at android.os.Looper.loop(Looper.java:236)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at android.app.ActivityThread.main(ActivityThread.java:8037)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at java.lang.reflect.Method.invoke(Native Method)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
  E/MethodChannel#br.uff.uffmobileplus/uffmobile_channel(11612):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
  </code></pre>