You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this helps, I'm currently using https://github.com/wfilleman/react-native-tcp in production which has TLS for both ios and android, but I don't feel confident in this package. So I'm having hopes for this package to maybe be a superior one 🙏
Is there a way to just ignore certificate check? We have a use case of users connecting to their own servers with self-signed certificates, so we don't know them in advance
@Overtorment, there is a way to ignore all certificate checks: you must set tlsCheckValidity to false in your createConnection() options. For more info, take a look at the documentation on the tls branch.
Right now, Android and iOS TCP clients are TLS/SSL compatible. Can you test it in your project and report the problems you find? If there are no issues, I will release a new version with the client SSL/TLS support.
success. tested tls/android. didn't test clearnet tcp and ios.
seems to work okay but there are some issues:
there are no methods setNoDelay, setKeepAlive, setEncoding. I commented them out, but they are available for sockets on all platforms I think.
a bit annoying that lib API does not conform to the one described in nodejs documentation. no big deal but I write isomorphic code and reuse it under RN environment and under nodejs environment. that means I will have to write more workarounds. example: createConnection creates a socket and connects it, while net package exposes sockets and allows you to connect later.
similar with nodejs tls package: it doesn't allow you to create socket, but creates connection on the spot, but method name is different (tls.connect) and arguments have different names.
@Overtorment, glad to hear it worked! I am sorry about those issues.
The methods setNoDelay, setKeepAlive, setEncoding are not implemented yet. I will update the documentation to make it clear.
The react-native-tcp-socket available API changes significantly from node net and tls because I am limited by my free time and native code development. The objective of this library is to provide a React Native API for TCP in both Android and iOS. That is why, right now, I am merging net and tls API's surfaces into one, so it is normal to have some differences.
All the available interface is in the documentation. If you have any questions, feel free to open an issue. I hope this library is good enough to suit your project!
PS: I will change the tlsCheckValidity to rejectUnauthorized to make things easier for you ;)
I think those methods you just need to proxy-call socket object on native system, you don’t need to implement anything.
So are you keeping lib api as is? Just to make sure, if it stays like this - it stays, that’s fine, just to know there won’t be any breaking changes :-)
There won't be any breaking changes. I will release the new version in 5 minutes.
About the methods setNoDelay, setKeepAlive and setEncoding, thanks for the tip! I will investigate. As soon as they are implemented, I will release a new version.
Can u please help me in this. I am trying to create Android TV Remote for IOS.
Like I wan to mimic node(tls.connect) using react native.
I need to implement a tls connection with Android TV from IOS device to send Remote Commands.
When I send below from IOS device with tls true it throws error
operation couldn’t be completed. (kcfstreamerrordomainssl error -9807.) const client = TcpSocket.createConnection({ port: '6467', host: "Android TV I.P", **tls**: true});
When I send below with no tls key from IOS device it makes connection but data returned from Android TV is not in proper format. So I was thinking this is because tls is false in below case. const client = TcpSocket.createConnection({ port: '6467', host: "Android TV I.P"});
Can u please help me in this. How to make a tls connection in React Nativ from IOS. Any help would be really helpful.
@piyush2cloud, if you have a problem, you should create a new issue. However, you could check nodeJS examples or seek help in stackoverflow for this kind of questions.
Hi how do i pass private key in client tls do you know how ?
const options = {
// Necessary only if using the client certificate authentication
key: fs.readFileSync('client_private_key.pem'),
cert: fs.readFileSync('client_cert.pem'),
// Necessary only if the server uses the self-signed certificate
ca: fs.readFileSync('server_cert.pem'),
}
this is what I use when I am working on nodejs what do I need to add for this to work in react-native ?
Activity
[-]TLS support?[/-][+]SSL/TLS support[/+]Rapsssito commentedon Apr 6, 2020
@Overtorment, thanks for your feature request. SSL was not planned originally, but I will take a closer look.
I might have to investigate about CocoaAsyncSockets known bugs with SSL. I will update you with any news about this topic.
Overtorment commentedon Apr 6, 2020
If this helps, I'm currently using https://github.com/wfilleman/react-native-tcp in production which has TLS for both ios and android, but I don't feel confident in this package. So I'm having hopes for this package to maybe be a superior one 🙏
Rapsssito commentedon Apr 6, 2020
Thanks for the reference, it helps a lot. I will take a look at their implementation and perform some tests.
I'll update ASAP with more information.
Overtorment commentedon Apr 6, 2020
Rapsssito commentedon Apr 7, 2020
@Overtorment, I have created a development branch for the SSL/TLS support.
If you want to check it out, you can add it to your project with the following command:
Overtorment commentedon Apr 7, 2020
Is there a way to just ignore certificate check? We have a use case of users connecting to their own servers with self-signed certificates, so we don't know them in advance
Rapsssito commentedon Apr 7, 2020
Rapsssito commentedon Apr 7, 2020
@Overtorment, there is a way to ignore all certificate checks: you must set
tlsCheckValidity
tofalse
in yourcreateConnection()
options. For more info, take a look at the documentation on thetls
branch.Right now, Android and iOS TCP clients are TLS/SSL compatible. Can you test it in your project and report the problems you find? If there are no issues, I will release a new version with the client SSL/TLS support.
Overtorment commentedon Apr 7, 2020
Will do!
Overtorment commentedon Apr 8, 2020
success. tested tls/android. didn't test clearnet tcp and ios.
seems to work okay but there are some issues:
setNoDelay
,setKeepAlive
,setEncoding
. I commented them out, but they are available for sockets on all platforms I think.createConnection
creates a socket and connects it, whilenet
package exposes sockets and allows you to connect later.similar with nodejs
tls
package: it doesn't allow you to create socket, but creates connection on the spot, but method name is different (tls.connect
) and arguments have different names.PS. cant test IOS atm
Rapsssito commentedon Apr 8, 2020
@Overtorment, glad to hear it worked! I am sorry about those issues.
The methods
setNoDelay
,setKeepAlive
,setEncoding
are not implemented yet. I will update the documentation to make it clear.The
react-native-tcp-socket
available API changes significantly from nodenet
andtls
because I am limited by my free time and native code development. The objective of this library is to provide a React Native API for TCP in both Android and iOS. That is why, right now, I am mergingnet
andtls
API's surfaces into one, so it is normal to have some differences.All the available interface is in the documentation. If you have any questions, feel free to open an issue. I hope this library is good enough to suit your project!
PS: I will change the
tlsCheckValidity
torejectUnauthorized
to make things easier for you ;)Overtorment commentedon Apr 8, 2020
I think those methods you just need to proxy-call socket object on native system, you don’t need to implement anything.
So are you keeping lib api as is? Just to make sure, if it stays like this - it stays, that’s fine, just to know there won’t be any breaking changes :-)
Rapsssito commentedon Apr 8, 2020
There won't be any breaking changes. I will release the new version in 5 minutes.
About the methods
setNoDelay
,setKeepAlive
andsetEncoding
, thanks for the tip! I will investigate. As soon as they are implemented, I will release a new version.github-actions commentedon Apr 8, 2020
🎉 This issue has been resolved in version 3.5.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
piyush2cloud commentedon Jan 31, 2022
@Overtorment @Rapsssito
Can u please help me in this. I am trying to create Android TV Remote for IOS.
Like I wan to mimic node(tls.connect) using react native.
I need to implement a tls connection with Android TV from IOS device to send Remote Commands.
When I send below from IOS device with tls true it throws error
operation couldn’t be completed. (kcfstreamerrordomainssl error -9807.)
const client = TcpSocket.createConnection({ port: '6467', host: "Android TV I.P", **tls**: true});
When I send below with no tls key from IOS device it makes connection but data returned from Android TV is not in proper format. So I was thinking this is because tls is false in below case.
const client = TcpSocket.createConnection({ port: '6467', host: "Android TV I.P"});
Can u please help me in this. How to make a tls connection in React Nativ from IOS. Any help would be really helpful.
Rapsssito commentedon Jan 31, 2022
@piyush2cloud, if you have a problem, you should create a new issue. However, you could check nodeJS examples or seek help in stackoverflow for this kind of questions.
punjasin commentedon May 19, 2023
Hi how do i pass private key in client tls do you know how ?
const options = {
// Necessary only if using the client certificate authentication
key: fs.readFileSync('client_private_key.pem'),
cert: fs.readFileSync('client_cert.pem'),
// Necessary only if the server uses the self-signed certificate
ca: fs.readFileSync('server_cert.pem'),
}
this is what I use when I am working on nodejs what do I need to add for this to work in react-native ?