adjust to netlib api changes

refs mitmproxy/mitmproxy#88