Fix DTLS setup (involves some test fixes as well)

that char* cast is awfully stinky