well, ssl seems to work well now. the bug is in strcpy, maybe it just overwrites unallocated memory