How I connect in Ubuntu 22.10 Gnome and IPVanish VPN.
Test machine:
Fresh install, no upgrades yet...
sudo apt-get install -y openvpn network-manager-openvpn network-manager-openvpn-gnome
The above packages were installed out of the box already, but may help someone else troubleshoot.
Speaking of troubleshooting...
tail -f /var/log/syslog
This displays errors from NetworkManager and other processes and is what clued me into the hack/fix which I found on a Kubuntu forum.
https://www.kubuntuforums.net/forum/currently-supported-releases/kubuntu-22-10/network-support-bc/666945-network-manager-fails-to-connect-to-open-vpn-expressvpn-terminal-works-fine
The error I was recieving (one of) was "NetworkManager[25475]: Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: keysize (2.6_git)"
The simple fix of commenting out the line "keysize 256" in /etc/NetworkManager/system-connections/ipvanish-US-Seattle-sea-a01.nmconnection fixed the issue.
Steps to fix...
sudo nano /etc/NetworkManager/system-connections/ipvanish-US-Seattle-sea-a01.nmconnection
Obviously this is an IPVanish specific configuration file, but the same concept may apply to other VPNs. Once you attempt to import a .ovpn file and connect, a network manager configuration file will be generated in the above directory (/etc/NetworkManager/system-connections/).
Change the line "keysize 256" to "#keysize 256" and save.
Now restart NetworkManager...
sudo systemctl restart NetworkManager
Connect to the VPN.
This is the easiest fix.
Other things I've tried...
Downgrading and holding openvpn as per wolfmanFP's instructions (this has worked in the past and is the only method I had success with, however, this stopped working for me yesterday after a fresh Ubuntu install, Kali too).
Maybe the libs got updated, maybe I missed/altered steps, but wolfmanFP's method used to work with 22.10 and now it doesn't (at least for me and this specific computer).
I've also tried Jan Kunzmann's method as well, which had no affect.
The error "nm-openvpn[26036]: DEPRECATED OPTION: --cipher set to 'AES-256-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations." is still present, but it still connects.
Anyway, this new method is consistent and only requires modifying one line in a config file.
Hope this helps you avoid hours of searching and troubleshooting.