再修正一个方法名中的单词错误:`Form` -> `From`
parent
fe31462c94
commit
15d4a88e15
|
@ -45,7 +45,7 @@ module.exports = class CertAndKeyContainer {
|
||||||
const _resolve = (_certObj) => {
|
const _resolve = (_certObj) => {
|
||||||
if (once) {
|
if (once) {
|
||||||
once = false
|
once = false
|
||||||
const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(_certObj.cert)
|
const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(_certObj.cert)
|
||||||
certPromiseObj.mappingHostNames = mappingHostNames // change
|
certPromiseObj.mappingHostNames = mappingHostNames // change
|
||||||
resolve(_certObj)
|
resolve(_certObj)
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ module.exports = class FakeServersCenter {
|
||||||
log.error(e)
|
log.error(e)
|
||||||
})
|
})
|
||||||
fakeServer.on('listening', () => {
|
fakeServer.on('listening', () => {
|
||||||
const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(certObj.cert)
|
const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(certObj.cert)
|
||||||
serverPromiseObj.mappingHostNames = mappingHostNames
|
serverPromiseObj.mappingHostNames = mappingHostNames
|
||||||
resolve(serverObj)
|
resolve(serverObj)
|
||||||
})
|
})
|
||||||
|
|
|
@ -230,7 +230,7 @@ utils.isMappingHostName = function (DNSName, hostname) {
|
||||||
return (new RegExp(reg)).test(hostname)
|
return (new RegExp(reg)).test(hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.getMappingHostNamesFormCert = function (cert) {
|
utils.getMappingHostNamesFromCert = function (cert) {
|
||||||
let mappingHostNames = []
|
let mappingHostNames = []
|
||||||
mappingHostNames.push(cert.subject.getField('CN') ? cert.subject.getField('CN').value : '')
|
mappingHostNames.push(cert.subject.getField('CN') ? cert.subject.getField('CN').value : '')
|
||||||
const altNames = cert.getExtension('subjectAltName') ? cert.getExtension('subjectAltName').altNames : []
|
const altNames = cert.getExtension('subjectAltName') ? cert.getExtension('subjectAltName').altNames : []
|
||||||
|
|
Loading…
Reference in New Issue