Code clean up, add back in certificate

This will allow everything to work smoothly. Also added in a debug file
for P12 certificates, will probably add more information.