One of the main electronic noise sources of a room temperature spectroscopy system is the leakage current of a detector. It can be reduced with a pn-junction type detector structure such as a M-i-n configuration, and with cooling. In this work eight CdZnTe detectors with a M-i-n structure were fabricated by indium diffusion. The junction was characterized by a currentvoltage technique. Detector electrical, charge collection and spectroscopic properties were compared to the ones received with the traditional electroless Au contacts, before the junction formation. As a result of the indium diffusion an improved detector leakage current performance was achieved. However, a corresponding improvement in the detector energy resolution was not always observed due to the CdZnTe charge collection properties and process variables.