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.
0
votes
I unfortunately had same question, spent couple of days to find an answer, but failed.
– Vladyslav Matviienko
@VladyslavMatviienko I have been searching this topic for a week. But I did not find any libraries or anything useful on this topic.
– Hasan Kucuk
@HasanKucuk did you find the solution?
– user7856586
@user7856586 There is no library that will allow it. It may be possible if you write your own protocols.
– Hasan Kucuk
@HasanKucuk thanks for reply. We used code from open vpn project. That's difficult, but I think there is no another way to build your own vpn app from scratch.
– user7856586
1 Answers
0
votes
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.