Ralvi Isufaj
May 17, 2017
2:31 pm

getGenericVpnProfile returns null for various VPN clients

I was trying to connect to a VPN server using various VPN clients in KNOX, but i keep getting a null reference to the GenericVpnPolicy object. The code is running outside of a container. This is the code snippet i used:

EnterpriseKnoxManager ekm = EnterpriseKnoxManager.getInstance();

GenericVpnPolicy gm = ekm.getGenericVpnPolicy("org.strongswan.android",0); //put 0 as the container id if no knox container is used


From this link: https://seap.samsung.com/forum-topic/openvpn-client-knox-getgenericvpnpr... i saw a list of VPN clients supported by KNOX. I've tested OpenVPN, Cisco AnyConnect and Strong Swan, but the only one that doesn't return a null reference is AnyConnect and I would like to work with the other clients.

Is my API call wrong somehow or is there anything else that I'm missing.




Similar topics

No similar topics found.
Samuel Veloso
May 19, 2017
7:17 pm

Hi Ralvi,

It seems that you're using the wrong VPN vendor. Please visit this link and download the correct StrongSwan VPN vendor client:


And then replace the package name in your arguments to "com.samsung.sVpn"

Best regards,



Hi Samuel,

Thank you, this works and i don't get a null reference anymore. Though, there now seems to be another issue. When i try to create the VPN profile, i get a 102 error value which i can see means: Vendor has returned an error indicating that the call to the API was not successful.

Is there any pointers you can give me, or show any documentation or example i can follow?



Ralvi IsufajMay 24, 2017 at 1:23 pm
Samuel Veloso
Jun 05, 2017
6:16 pm

Hi Ralvi,

I'm encountering the same behavior.

To troubleshoot further, please create a support ticket at https://www.samsungknox.com/en/support

Best regards,