How to create IPSec/L2TP psk vpn for android

这一生的挚爱 提交于 2020-02-23 07:27:15

问题


I need to connect a Vpn programmatically in my app, but can't seem to find a way. I see VpnService, StrongSwan, OpenVpn but this seems not IPSec. How do I go about connecting to my already build IPSec and L2TP servers that have a username, password and pre shared key.


回答1:


You can not do it in the latest versions of Android. It could be done via SystemProperties.java class which has API available for these connections, but these API are now hidden in the latest Android versions due to Security risks.

However if the phone is rooted then you can use it via hacks like reflection etc to access those System properties and get everything going.



来源:https://stackoverflow.com/questions/50021979/how-to-create-ipsec-l2tp-psk-vpn-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!