adjust to new tls API
make use of stack configurable via environment variable NET
Merge pull request #1 from mirleft/fixes

Fixes