Fix non-TLS build. Detection and fix by Todd Lyons.