How to configure the wifienterpriseconfig to connect to an EAP network that has a proxy?

0

If it is not by config wifienterprise please help me

final WifiConfiguration conf = new WifiConfiguration();
        wifiEnterpriseConfig = new WifiEnterpriseConfig();
        conf.SSID = "\"" + networkSSID + "\"";   // Please note the quotes. String should contain ssid in quotes
        conf.status = WifiConfiguration.Status.ENABLED;
        conf.priority = 40;

        Toast.makeText(this, "Verificando seguridad de la red: " + networkSSID, Toast.LENGTH_SHORT).show();

        if (scanResult.capabilities.toUpperCase().contains("WEP")) {
            Log.v("rht", "Configurando WEP");

            conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
            conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
            conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
            conf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
            conf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);

            if (networkPass.matches("^[0-9a-fA-F]+$")) {
                conf.wepKeys[0] = networkPass;
            } else {
                conf.wepKeys[0] = "\"".concat(networkPass).concat("\"");
            }

            conf.wepTxKeyIndex = 0;

        } else if (scanResult.capabilities.toUpperCase().contains("EAP")) {
            Log.v("EAP", "Configurando EAP");

            wifiEnterpriseConfig.setIdentity(networkIdentity);
            wifiEnterpriseConfig.setPassword(networkPass);

            /**insertamos la configuracion del proxy*/

            /**desenmascaramos la pagina web*/
            callWebActivity();

        } else if (scanResult.capabilities.toUpperCase().contains("WPA")) {
            Log.v("rht", "Configurando WPA");

            conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
            conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
            conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);

            conf.preSharedKey = "\"" + networkPass + "\"";

        } else {
            Log.v("rht", "Configurando OPEN network");
            conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
            conf.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
            conf.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
            conf.allowedAuthAlgorithms.clear();
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
            conf.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
            conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);

            Toast.makeText(this, "Te vas a conectar a una red abierta", Toast.LENGTH_SHORT).show();
        }

After this I connect but the problem is that I do not know how to set a proxy and tell it not to use it for: *. xxx.xxx

    
asked by Alex Rivas 09.04.2018 в 16:31
source

0 answers