fix SNI (tested with OpenSSL, maybe needs fixes for gnutls)

compiles and works ok for OpenSSL

for gnutls, could not build it:

 LINK    src/inadyn
/usr/bin/ld: src/ssl.o: undefined reference to symbol 'gnutls_server_name_set@@GNUTLS_1_4'
//usr/lib/x86_64-linux-gnu/libgnutls.so.26: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [src/inadyn] Error 1

also please check my C, it is a bit rusty.