fix(js): respect network policy before dialing ldap (#7494)