Try to generate certificate with short host name before set hostname to localhost