Combine chocolate and butter in the top of a saucepan placed over a pot of simmering water; simmer over medium heat until melted, about 5 minutes.
Combine sugar, cornstarch, and salt in a bowl; stir in about 1/4 cup milk. Add mixture to melted chocolate and blend thoroughly. Add remaining milk. Place saucepan over direct heat and cook, stirring constantly, until mixture boils and thickens, about 1 minute more. Return the saucepan to the pot of boiling water, cover, and cook 15 minutes longer, stirring occasionally.
Remove the saucepan from heat and stir in vanilla. Cool in the refrigerator, about 3 hours to overnight before serving.