diff --git a/packages/mitmproxy/src/lib/proxy/tls/CertAndKeyContainer.js b/packages/mitmproxy/src/lib/proxy/tls/CertAndKeyContainer.js index d034436c..036442b6 100644 --- a/packages/mitmproxy/src/lib/proxy/tls/CertAndKeyContainer.js +++ b/packages/mitmproxy/src/lib/proxy/tls/CertAndKeyContainer.js @@ -45,7 +45,7 @@ module.exports = class CertAndKeyContainer { const _resolve = (_certObj) => { if (once) { once = false - const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(_certObj.cert) + const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(_certObj.cert) certPromiseObj.mappingHostNames = mappingHostNames // change resolve(_certObj) } diff --git a/packages/mitmproxy/src/lib/proxy/tls/FakeServersCenter.js b/packages/mitmproxy/src/lib/proxy/tls/FakeServersCenter.js index 2e899ab0..a7fe8d30 100644 --- a/packages/mitmproxy/src/lib/proxy/tls/FakeServersCenter.js +++ b/packages/mitmproxy/src/lib/proxy/tls/FakeServersCenter.js @@ -90,7 +90,7 @@ module.exports = class FakeServersCenter { log.error(e) }) fakeServer.on('listening', () => { - const mappingHostNames = tlsUtils.getMappingHostNamesFormCert(certObj.cert) + const mappingHostNames = tlsUtils.getMappingHostNamesFromCert(certObj.cert) serverPromiseObj.mappingHostNames = mappingHostNames resolve(serverObj) }) diff --git a/packages/mitmproxy/src/lib/proxy/tls/tlsUtils.js b/packages/mitmproxy/src/lib/proxy/tls/tlsUtils.js index d0b42ede..4c75cecb 100644 --- a/packages/mitmproxy/src/lib/proxy/tls/tlsUtils.js +++ b/packages/mitmproxy/src/lib/proxy/tls/tlsUtils.js @@ -230,7 +230,7 @@ utils.isMappingHostName = function (DNSName, hostname) { return (new RegExp(reg)).test(hostname) } -utils.getMappingHostNamesFormCert = function (cert) { +utils.getMappingHostNamesFromCert = function (cert) { let mappingHostNames = [] mappingHostNames.push(cert.subject.getField('CN') ? cert.subject.getField('CN').value : '') const altNames = cert.getExtension('subjectAltName') ? cert.getExtension('subjectAltName').altNames : []