Make the pastry cream first: whisk the sugar, cornstarch, and salt in a saucepan, then gradually whisk in the milk until smooth. Cook over medium heat, whisking constantly, until thick and bubbling, then cook 1 minute more.
Remove from the heat and stir in the butter and vanilla. Transfer to a bowl, press plastic wrap directly onto the surface, and refrigerate for at least 2 hours.
Preheat the oven to 350F and grease and line two 8-inch round pans. Stir the milk and vinegar together and let sit for 5 minutes.
Whisk the flour, sugar, baking powder, baking soda, and salt in a large bowl. Add the oil and vanilla to the milk mixture, then stir the wet ingredients into the dry just until smooth.
Divide the batter between the pans and bake for 22-25 minutes, until a toothpick comes out clean. Cool in the pans for 10 minutes, then transfer to racks to cool completely.
Place one cake layer on a serving plate and spread all of the chilled pastry cream over it, stopping 1/2 inch from the edge. Top with the second layer and press down gently.
For the glaze, heat the heavy cream until just simmering, pour it over the chopped chocolate, let stand 2 minutes, then stir until smooth.
Let the glaze cool for 5 minutes until slightly thickened, then pour it over the top of the cake, letting it drip down the sides.
Refrigerate for 1 hour to set the glaze and filling before slicing.