use an error handler to turn php output into an exception, make generateCert private