Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I would like to configure an Enterprise WiFi network for the user of my app.
Therefor the user has to enter his username and password, the rest should be handled by the App.
The authentication is handled by a RADIUS server (FreeRadius 3), the server uses a certificate issued by LetsEncrypt (so there is no need to import my own CA cert).
When I manually configure the network via the settings app, I choose "USe System Certificates" as CA certificate and set the domain to "example.org".
How can I set this option using WifiEnterpriseConfig?
This is my code so far:
WifiConfiguration wfc = new WifiConfiguration();
wfc.SSID = "\"SomeSSID\"";
wfc.status = WifiConfiguration.Status.DISABLED;
wfc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
wfc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
wfc.enterpriseConfig.setIdentity(username);
wfc.enterpriseConfig.setPassword(password);
wfc.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PEAP);
wfc.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAPV2);
// How can I set "use system certificates"?
// wfc.enterpriseConfig.setCaCertificate(?); ???
wfc.enterpriseConfig.setDomainSuffixMatch("example.org");
After executing this code, the network is configured but CA Cert is set to "no validation" and the domain is not set.
Thank you for your help
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.