You are not logged in.
Pages: 1
Hey all,
does anyone has an example code for a TCP Socket Connection with openssl?
I want to use either windows or linux - both should be possible.
Thanks for your help!
Offline
hey all,
i researched much over the weekend but i keep up my question and try to ask, if anyone has a working example for using TNetSocket.
This would be really great.
Thanks and have a great day
Offline
Sorry for the delayed answer.
For TCP + TLS, the easiest is to use TCrtSocket.
On Windows, you need to define the USE_OPENSSL and FORCE_OPENSSL conditionals in YOUR project options to have this code actually link to the OpenSSL library from mormot.lib.openssl11.
Otherwise, it would use the system SChannel - which is likely to be enough for most simple cases, at least on a recent Windows version.
Offline
Hello Ab
,
thank you for your answer and no worries.
Do you know about any sample or project, where this is already used?
Sometimes it is easier to see how this can be implemented instead of guessing what should be the right approach.
The Chat-programm in the examples is different as i can see.
Offline
You have a sample of using TCrtSocket with optional TLS support in mormot.net.client.
Just look at the SendEmail() function.
Note that you are not required to use SockIn or SockOut: if you know the size of your frames, you can just use direct access to the socket, e.g. SockInPending() or SockSend/SockSendFlush.
Offline
Pages: 1