0

I have a TCP client and server and I want to implement a security layer using GnuTLS. I have read in the GnuTLS documentation and they don't speak about connect to a specific ip address nor port. They do set an ip address in an certtool template that can be used to generate a certificate request.

But in my case, as a client, I get the server address during a UDP session, and then I connect my TCP socket to it.

In the example given in the documentation there is this line :

(session, GNUTLS_NAME_DNS, "my_host_name", strlen("my_host_name"));

...which I believe is responsible to get the server address.

Jean
  • 1,707
  • 3
  • 24
  • 43

1 Answers1

0

This example helped me : Both the IP address and port are used to connect to the server who wait for connections on the given port.

https://defuse.ca/gnutls-psk-client-server-example.htm

Jean
  • 1,707
  • 3
  • 24
  • 43