Prepare the chiles. Wearing latex or rubber gloves, cut off the stems of the chiles. Split the chiles open, carve out the ribs and scrape out the seeds. Discard the ribs and seeds. (Some or all of the seeds can be retained and added to the sauce if you want to increase the heat level.) Cut the flesh of the chiles roughly into chunks. Peel and crush the garlic. Break apart the cloves from each head of garlic. Peel the cloves of garlic. Crush each clove by pressing it under the side of a chef's knife or cleaver. Begin the infusion. Add the vinegar, salt and sugar to a non-reactive container. Whisk to combine until the salt and sugar are dissolved. Add the chiles and garlic. Cover and refrigerate overnight. Prepare the jars and lids. When you're ready to make the sauce the next day, wash all jars and lids thoroughly with soap and water and rinse well. Fill your canner with enough water to cover the jars by at least 1 inch and bring to a simmer. Using a pair of canning tongs, lower the jars in gently, tilting them to fill with the hot water. In a small saucepan, keep some water warm but not boiling; place the lids in the water. Have an additional kettle of water on to boil. Cook the sauce. Strain the chiles and garlic from the vinegar. Add the vinegar to a medium saucepan and bring to a boil. Boil until reduced by about half. Add the chiles and garlic, bring back to the boil, and then reduce heat and simmer until the chiles and garlic are completely soft, about 10 minutes. Blend the sauce. Carefully pour the entire mixture into a blender. Put on the lid and blend, starting at a slow speed to break down the solids, and increasing to a high speed until completely blended to a smooth consistency. Fill and close the jars. Using canning tongs, remove the jars from the canner, carefully pouring the water back into the canner. Set next to the sauce in the saucepan. Turn the heat under the canner to high. Use a ladle to pour the sauce into the jars through a canning funnel, leaving 1/2 inch headspace at the top. Run a clean chopstick around the inside of the jar to dislodge any trapped air. Wipe the rims of the jars with a damp paper towel. Place the lids on, and screw on the rings until just finger-tight. Seal the jars. Using canning tongs, gently transfer the jars to the canner, taking care to keep them vertical. When all the jars are in the canner, there should be at least 1 inch water covering them; if you need more, add water from the kettle until the jars are sufficiently covered. Bring the water to a full rolling boil, and process for 10 minutes. Remove and cool. Using canning tongs, gently remove the jars from the canner and transfer them to a kitchen towel or cooling rack, again keeping them vertical. Do not set hot jars directly on to cool counter surfaces. Leave to cool, undisturbed, for at least 12 hours. If any of the jars do not seal when cool, reprocess using the method above, or refrigerate and use immediately. Label and store. Add a label to the lid or side of your jar, noting the date it was canned. Remove the rings and store jars in a cool, dark place for up to one year. Refrigerate after opening. Properly-handled sterilized equipment will keep canned foods in good condition for years. Sterilizing jars is the first step of preserving foods.