Fixed generation of self-sign certificate
Removed test function