Client/Server TCP TLS communication problem

Just starting out? Need help? Post your questions and find answers here.
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: Client/Server TCP TLS communication problem

Post by PBJim »

tatanas wrote: Wed Apr 16, 2025 2:36 pm I think I found where the problem is coming from. It seems that the mixing of TLS and non-TLS clients connecting to the TLS server is the cause.
I'd intended to reply yesterday but didn't have chance. I did not think it was possible to open a non-encrypted client connection to a server expecting TLS, which you say you're doing...
And for now, I don't have separate loops to handle TLS and non TLS clients. I will change the port on TLS clients so only them could connect to the TLS server.
[...]
It seems that the mixing of TLS and non-TLS clients connecting to the TLS server is the cause.
Having now just tried it, I can confirm that it doesn't work. This is from the example TLS server and client https://www.purebasic.com/documentation ... rktls.html but removing the TLS switch at the client-side. It returns garbage at the client side, as I'd expected.

Image
Last edited by PBJim on Thu Apr 17, 2025 10:14 am, edited 1 time in total.
infratec
Always Here
Always Here
Posts: 7604
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Client/Server TCP TLS communication problem

Post by infratec »

I wrote a ldap server and since 2 month I implemeted also TLS (before I used stunnel)

I create to servers, since the ports are different and you definately need to use NetworkServerEvent(Server) to specify the server
for the events.

It is not normal to do TLS and not crypted on the same port.

It is running without problems.
tatanas
Enthusiast
Enthusiast
Posts: 260
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: Client/Server TCP TLS communication problem

Post by tatanas »

I confirm, at the moment my server is handling 280 simultaneous TLS connections without problem.
Windows 10 Pro x64
PureBasic 6.20 x64
Post Reply