The president raged at his former national security adviser in a post-midnight tweet.