When manually setting the key management, this will actually cause wifi to not connect if a different type is used by the access point.
WPA supplicant typically can detect the key management from the access point's broadcast, and not overriding it has a bigger chance of succeeding.
As a `wpa_cli` newbie, I just followed the instructions in the manual on the minimal install disk and they didn't work. I tried setting `key_mgmt` what was shown in the scan results, but `wpa_cli` barfed at the string (quoted or unquoted). Only when dropping the `set key_mgmt` line entirely, it worked. So I think this would provide a better help for people using the minimal install disk.