You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
response_id":"WIREGUARD_PEER_PRESHAREDKEY_INVALID","message":"Field presharedkey must be a valid WireGuard pre-shared key
To Reproduce
Make a POST request to /api/v2/vpn/wireguard/peer with presharedkey set to null or an empty string. You will get a WIREGUARD_PEER_PRESHAREDKEY_INVALID error.
Describe the bug
Getting the following error when I tried to post/patch for the URL https://mypfsense.org/api/v2/vpn/wireguard/peer'
response_id":"WIREGUARD_PEER_PRESHAREDKEY_INVALID","message":"Field
presharedkey
must be a valid WireGuard pre-shared keyTo Reproduce
Make a POST request to /api/v2/vpn/wireguard/peer with presharedkey set to null or an empty string. You will get a WIREGUARD_PEER_PRESHAREDKEY_INVALID error.
See the code snippet below.
peer_params =
{'id': '20', 'enabled': True, 'tun': 'tun_wg20', 'endpoint': 'valid_ip_address', 'port': '51820', 'descr': '', 'persistentkeepalive': None, 'publickey': 'validkey=', 'allowedips': [{'parent_id': '20', 'id': 0, 'address': '0.0.0.0', 'mask': 0, 'descr': ''}], 'presharedkey': ' ', 'name': 'tun_wg20'}
url = 'https://mypfsense.org/api/v2/vpn/wireguard/peer'
out = requests.post(url, json = peer_params, verify=True, headers=headers)
This will produce an error like below.
response_id":"WIREGUARD_PEER_PRESHAREDKEY_INVALID","message":"Field
presharedkey
must be a valid WireGuard pre-shared keyExpected behavior
Empty strings should be allowed by the Model
pfSense Version & Package Version:
Affected Endpoints:
The text was updated successfully, but these errors were encountered: