Skip to content

Commit f03c627

Browse files
committed
support automatic cert creation for IP addresses
1 parent 9025443 commit f03c627

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ca.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ CA.prototype.generateServerCertificateKeys = function (hosts, cb) {
213213
certServer.setExtensions(ServerExtensions.concat([{
214214
name: 'subjectAltName',
215215
altNames: hosts.map(function(host) {
216+
if (host.match(/^[\d\.]+$/)) {
217+
return {type: 7, ip: host};
218+
}
216219
return {type: 2, value: host};
217220
})
218221
}]));

0 commit comments

Comments
 (0)