protected function writeCustomConfigFile(string $fileName, array $subjectAltNames) {
        $content = implode(PHP_EOL, [
            '[req]',
            'prompt = no',
            'string_mask = utf8only',
            'distinguished_name = req_distinguished_name',
            '[req_distinguished_name]',
            '[req_extensions]',
            'subjectAltName = '.implode(',', $subjectAltNames)
        ]);
        file_put_contents($fileName, $content);
    }