Add server method to generate ca cert
Remove unused code