SDK Wi-Fi Sta sample app will not connect to WPA2 AP - broken wifi_connect_req_params.security setting

The 2.3 SDK Wi-Fi sta sample app does not appear to work like it did with SDK 2.2, at least with my access point running WPA2.

It looks like the net_mgmt() macro call does not work with CONFIG_STA_KEY_MGMT_WPA2=y.  

The sta sample code __wifi_args_to_params() sets wifi_connect_req_params.security to STA_KEY_MGMT_WPA2, which does not work.
Overriding it and setting wifi_connect_req_params.security to WIFI_SECURITY_TYPE_PSK before net_mgmt() macro does connect successfully.
The wi-fi shell sample app does work. It sets wifi_connect_req_params.security to WIFI_SECURITY_TYPE_PSK

	if (net_mgmt(NET_REQUEST_WIFI_CONNECT, iface,
		     &cnx_params, sizeof(struct wifi_connect_req_params))) {
		LOG_ERR("Connection request failed");

		return -ENOEXEC;
	}

Related