I changed the proxy settings with the following code:
sudo networksetup -setwebproxy Wi-Fi IP_ADDRESS PORT on USERNAME PASSWORD
It does indeed changes settings, but throws an error saying:
error -25299 attempting to create account and password for proxy
What could be the reason for this? I think it has something to do with
Keychain app, since after changing proxy in Network tab, I also need to press
Allow/Always allow when this popup is triggered(right after changing proxy settings). Using sudo command above doesn't manage this popup.
Any idea how to solve this problem?