{"action":"opened","issue":{"url":"https://api.github.com/repos/oetiker/AcmeFetch/issues/2","labels_url":"https://api.github.com/repos/oetiker/AcmeFetch/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/oetiker/AcmeFetch/issues/2/comments","events_url":"https://api.github.com/repos/oetiker/AcmeFetch/issues/2/events","html_url":"https://github.com/oetiker/AcmeFetch/issues/2","id":127279765,"number":2,"title":"Fails with only one name","user":{"login":"sludin","id":2185475,"avatar_url":"https://avatars.githubusercontent.com/u/2185475?v=3","gravatar_id":"","url":"https://api.github.com/users/sludin","html_url":"https://github.com/sludin","followers_url":"https://api.github.com/users/sludin/followers","following_url":"https://api.github.com/users/sludin/following{/other_user}","gists_url":"https://api.github.com/users/sludin/gists{/gist_id}","starred_url":"https://api.github.com/users/sludin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sludin/subscriptions","organizations_url":"https://api.github.com/users/sludin/orgs","repos_url":"https://api.github.com/users/sludin/repos","events_url":"https://api.github.com/users/sludin/events{/privacy}","received_events_url":"https://api.github.com/users/sludin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-18T17:54:45Z","updated_at":"2016-01-18T17:54:45Z","closed_at":null,"body":"If you have only one name on the cert the script fails in makeCsr because there are no names for the SAN section.  It is OK (or at least very common) to have the commonName in the SAN section as well.  Changing:\r\n\r\n $cert->{altNames} = join ',', map {\"DNS:$_\"} grep {$_ ne $cert->{commonName}} sort keys %{$cert->{SITES}};\r\n\r\nto\r\n\r\n    $cert->{altNames} = join ',', map {\"DNS:$_\"} sort keys %{$cert->{SITES}};\r\n\r\ntakes care of it but you might want to do something more conditional based on the number of names.\r\n"}}