Open yasirwahid opened 3 years ago
Same issue, did you find a solution?
Hi I am Facing Same issue Did you find any solution
Sorry, but the project is only a test and unfortunately it doesn't work. I will remove it from github.
Actually I made it working. Just use a valid certificate. I used CA as b64ca and certificate from .sswan as b64userCert
Just tested it on android TV box (android 9) and friend's phone on android 12 :)
@cristinaITdeveloper thanks for the work btw
connectVpn = () => {
if(selectedServer == null){
Alert.alert('Error', 'You have to choose a server')
} else {
setIsConnecting(true)
connect(
'example',
selectedServer.address,
selectedServer.username,
selectedServer.password,
selectedServer.vpnType,
selectedServer.secret,
false,
0,
selectedServer.b64CaCert,
selectedServer.b64UserCert,
''
)
.then((r) => {
setIsConnecting(false);
console.log(r, 'connected');
})
.catch((error) => {
setIsConnecting(false);
console.log('eeeerrrr', error);
})
}
}
I used CA cert (ikev2vpnca.cer) generated by this:
openssl pkcs12 -in vpnclient.p12 -cacerts -nokeys -out ikev2vpnca.cer
And User cert is taken from here.
/root/vpnclient.sswan (for Android)
It's automatically created with the oneliner to set up vpn:
https://github.com/hwdsl2/setup-ipsec-vpn
And vpnType & secret could be empty as they are not used: https://github.com/cristinaITdeveloper/react-native-ipsec-ikev2/blob/c6239c2de8f00431a414290f03f22caa98929034/android/src/main/java/com/sijav/reactnativeipsecvpn/RNIpSecVpn.java#L139
Cristina, are you going to continue working on this?
@darknessproduction unfortunately I can't work on it at the moment. If you want you can contribute on this.
@darknessproduction Hi, what version of React Native are you using?
@Grkmyldz148
{ "name": "darkpass", "version": "0.0.1", "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "start": "react-native start", "lint": "eslint ." }, "dependencies": { "react": "16.13.1", "react-native": "0.63.2", "react-native-ikev2-ipsec": "^1.1.15" }, "devDependencies": { "@babel/core": "^7.8.4", "@babel/runtime": "^7.8.4", "@react-native-community/eslint-config": "^1.1.0", "babel-jest": "^25.1.0", "eslint": "^6.5.1", "metro-react-native-babel-preset": "^0.59.0", "prettier": "2.0.5" }, "jest": { "preset": "react-native" } }
Hey, i have tried react-native-ip-sec-vpn and its listeners are working but cant seem to connect the vpn in android.
then i have tried this library and its example project is crashing, when i installed the library in a new custom app its listeners of state change are not working , seems like nothing is happening what i have done wrong?
i have copy pasted example app.js code.