Prepare peppers. Rinse the dried chile peppers under some water to remove any dirt. Pat them dry with a towel.
Cook chile peppers. Place a skillet over medium heat. Cook the chile peppers for 8-10 seconds or until they just start to puff up and bliste. Then flip them over and cook for another 8-10 seconds or until they resemble the other side. (You want to prevent the chile peppers from burning; this will affect the taste of the sauce.)
Cool and remove stems and seeds. Transfer the chiles to a plate lined with a paper towel to cool. Once cool enough to handle, remove the stem and seeds and discard them. Tear the chiles into a few pieces and transfer them to a bowl.
Soak chiles. Cover the chiles with 2 cups of boiling water. Cover with a tea towel and allow the chiles to sit for 20 minutes. Once the chiles are soft, reserve 1 cup of the soaking water and then drain the chiles.
Saute garlic. In a large pot over medium heat, add the olive oil. Once the olive oil has warmed, add the garlic and saute for about 30 seconds.
Caramelize onions. Next, add the onions and stir until well incorporated. Bring the heat down to medium-low and cover. About every minute or so, stir the onions, making sure they don’t stick to the bottom of the pot or burn. Do this for about 10 minutes. Once the onions are nice and soft, remove the lid and cook for another 5-10 minutes, stirring often until they are nicely caramelized.
Add rest of ingredients. Add the tomatoes, brown sugar, chile powder, cocoa powder, cumin, salt, softened chile peppers, and reserved water. Stir to combine. If you want more heat, add in the optional red pepper flakes at this point. Remove from the heat.
Blend. Working in batches, process the tomato mixture in a blender or food processor until nice and smooth.
Simmer mixture. Transfer back into the large pot and bring to a boil. Once boiling, reduce the heat to a simmer and allow the mixture to simmer for about 30 minutes or until it has thickened and has darkened in color.
Prepare for canning. While the sauce is simmering, wash the jars in hot soapy water. Transfer them to the pressure canner and add enough water so the jars are about half full and the water is to the recommended line. Cover (but don’t seal) and place over medium-high heat. Place your rings and lids into a saucepan with water, place over low heat, and bring to a simmer.
Fill jars. Once the sauce has thickened, ladle it into the hot jars, leaving 1-inch head space. Remove any air bubbles using a debubbler, and then wipe the rims off with a clean, damp cloth or a vinegar-moistened cloth. Place the lids on top, followed by the rings, and tighten them until they are fingertip-tight.
Process jars. Transfer them into the pressure canner. Fill the canner with at least 2 inches of water or to the recommended line of your pressure canner. Place the canner lid on and secure it tight. Set over medium-high heat and allow the canner to vent continuous steam. Once the steam is venting, allow it to steam for 10 minutes. After the 10 minutes, set your weighted canner to 10 pounds or your dial to 11 pounds (adjusting for elevation) and process jars for 50 minutes. If your pressure drops below 10 pounds for weighted or 11 pounds for dial, stop the timer, bring the canner back up to pressure, and restart the timer. This sauce needs to be processed for 50 minutes at the correct pressure.
Cool. After 50 minutes, turn off the heat and allow the pressure to drop to zero naturally. Once the pressure is at zero, remove the weight or set the dial to zero and allow the steam to vent. Wait 5 minutes after the venting has stopped before removing the lid. Remove the lid by tilting the lid away from you. Allow the jars to sit in the canner for 10 minutes. Transfer jars to a heat-safe place and allow them to cool for 12-24 hours.
Check seals. After they’ve cooled for 24 hours, check the seal. If they have a proper seal, label them and store them in a cool, dark place for up to 18 months (per your lids manufacturer’s recommendations).