Ok cool, what about the nifi logs? The stack trace might have reasoning behind a loss in connection. Also; can you make a GET request to the twitter API outside of the context of the VM? https://github.com/sferik/t
To @Wynner 's point; this seems like a firewall or networking issue. You'll need to troubleshoot connectivity outside of NIFI and see why you are unable to make a connection.