Core: more correct check for REQUIRE_TLS
Core: fix incorrect check in connmanager