Preheat the oven to 350 F. Grease two round cake pans, then line the bottoms with parchment.
Combine the flour, cocoa, baking soda, espresso powder, and salt in a bowl.
In a large bowl with an electric mixer, cream the butter and sugar together until fluffy, about 3-4 minutes. Add the vanilla and oil and incorporate, about another minute.
Add the eggs one at a time and beat to combine.
Add ¼ cup of buttermilk and combine, then add ½ cup of the flour mixture and combine. Repeat, alternating between buttermilk and flour, until all ingredients are incorporated.
Divide the batter between cake pans and bake 30 to 35 minutes, or until a toothpick inserted into the center comes out clean.
When cool enough to handle, remove the cakes from the pans and let them cool completely on a wire rack.
In the meantime, make the frosting. Combine the sugar, flour, and salt in a saucepan.
Add the milk and set the saucepan over medium heat. Whisk constantly until thickened to a pudding-like consistency, about 3 minutes. The mixture should coat the back of a spatula.
Spread the mixture on a sheet tray and cover it with plastic wrap, pressing the wrap into the pudding to avoid a skin. Chill until completely cooled, at least 30 minutes.
Once the mixture is chilled, beat the softened butter in a large bowl until fluffy, about 3 minutes. Scrape the sides.
Add the pudding mixture ¼ cup at a time, beating until fully incorporated. Add the vanilla and beat to combine until fluffy.
To build the cake, place one cake on a cake stand and spread ermine frosting on top of the first layer. Stack the second cake on top of the first.
Frost the cake, first starting with the top, then frosting the sides. Serve after frosting.