WiFi PSK with spaces does not work
Summary
Connecting to a WiFi network with spaces in the PSK (passphrase) does not work.
Version affected
Arch Linux nmcli tool, version 1.44.0-1 Gnome desktop, also nm-connection-editor
Steps to reproduce
Have a Wifi network with spaces in the PSK. Try to connect to this network.
Actual result
Connecting fails
Expected result
Connecting works
Relevant logs
<info> [1696233538.4491] device (wlp18s0f4u1u4): Activation: starting connection 'tuxtest' (3af9b80c-3293-45ee-90b1-b065c78a0196)
<info> [1696233538.4492] audit: op="connection-add-activate" uuid="3af9b80c-3293-45ee-90b1-b065c78a0196" name="tuxtest" pid=131064 uid=1000 result="success"
<info> [1696233538.4493] device (wlp18s0f4u1u4): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1696233538.5027] device (wlp18s0f4u1u4): set-hw-addr: reset MAC address to 18:D6:C7:xx:xx:xx (preserve)
<info> [1696233538.7139] device (wlp18s0f4u1u4): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1696233538.7140] device (wlp18s0f4u1u4): Activation: (wifi) access point 'tuxtest' has security, but secrets are required.
<info> [1696233538.7140] device (wlp18s0f4u1u4): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
<info> [1696233538.7150] device (wlp18s0f4u1u4): supplicant interface state: disconnected -> interface_disabled
<info> [1696233538.7151] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: disconnected -> interface_disabled
<info> [1696233538.7596] device (wlp18s0f4u1u4): supplicant interface state: interface_disabled -> inactive
<info> [1696233538.7596] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: interface_disabled -> inactive
<info> [1696233544.1943] device (wlp18s0f4u1u4): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1696233544.1944] device (wlp18s0f4u1u4): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1696233544.1945] device (wlp18s0f4u1u4): Activation: (wifi) connection 'tuxtest' has security, and secrets exist. No new secrets needed.
<info> [1696233544.1945] Config: added 'ssid' value 'tuxtest'
<info> [1696233544.1945] Config: added 'scan_ssid' value '1'
<info> [1696233544.1945] Config: added 'bgscan' value 'simple:30:-70:86400'
<info> [1696233544.1945] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
<info> [1696233544.1945] Config: added 'auth_alg' value 'OPEN'
<info> [1696233544.1945] Config: added 'psk' value '<hidden>'
<info> [1696233544.2860] device (wlp18s0f4u1u4): supplicant interface state: inactive -> scanning
<info> [1696233544.2860] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: inactive -> scanning
<info> [1696233545.6879] device (wlp18s0f4u1u4): supplicant interface state: scanning -> authenticating
<info> [1696233545.6879] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: scanning -> authenticating
<info> [1696233545.6905] device (wlp18s0f4u1u4): supplicant interface state: authenticating -> associating
<info> [1696233545.6905] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: authenticating -> associating
<info> [1696233545.7621] device (wlp18s0f4u1u4): supplicant interface state: associating -> completed
<info> [1696233545.7621] device (wlp18s0f4u1u4): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "tuxtest"
<info> [1696233545.7621] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: associating -> completed
<info> [1696233545.7622] device (wlp18s0f4u1u4): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<info> [1696233545.7624] dhcp4 (wlp18s0f4u1u4): activation: beginning transaction (timeout in 45 seconds)
<info> [1696233590.9976] device (wlp18s0f4u1u4): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
<info> [1696233591.1466] device (wlp18s0f4u1u4): set-hw-addr: set MAC address to 0A:58:C2:xx:xx:xx (scanning)
<warn> [1696233591.3579] device (wlp18s0f4u1u4): Activation: failed for connection 'tuxtest'
<info> [1696233591.3580] device (wlp18s0f4u1u4): supplicant interface state: completed -> interface_disabled
<info> [1696233591.3580] device (p2p-dev-wlp18s0f4u1u4): supplicant management interface state: completed -> interface_disabled
<info> [1696233591.3582] device (wlp18s0f4u1u4): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
<info> [1696233591.4043] dhcp4 (wlp18s0f4u1u4): canceled DHCP transaction
NetworkManager Connection Configuration
[connection]
id=tuxtest
uuid=bfb7ec15-a371-4204-bc95-42a41bfd3a65
type=wifi
interface-name=wlp18s0f4u1u4
[wifi]
mode=infrastructure
ssid=tuxtest
[wifi-security]
key-mgmt=wpa-psk
psk=ab cd ef
[ipv4]
method=auto
[ipv6]
addr-gen-mode=stable-privacy
method=auto