node-opcua-pki 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ignore +6 -6
- package/.prettierrc +5 -5
- package/LICENSE +22 -22
- package/bin/crypto_create_CA.js +0 -0
- package/bin/crypto_create_CA_config.example.js +18 -18
- package/bin/install_prerequisite.js +9 -9
- package/dist/crypto_create_CA.d.ts +2 -2
- package/dist/crypto_create_CA.js +897 -897
- package/dist/index.d.ts +6 -6
- package/dist/index.js +44 -44
- package/dist/misc/applicationurn.d.ts +1 -1
- package/dist/misc/applicationurn.js +46 -46
- package/dist/misc/hostname.d.ts +8 -8
- package/dist/misc/hostname.js +102 -102
- package/dist/misc/install_prerequisite.d.ts +9 -9
- package/dist/misc/install_prerequisite.js +363 -360
- package/dist/misc/install_prerequisite.js.map +1 -1
- package/dist/misc/subject.d.ts +26 -26
- package/dist/misc/subject.js +121 -121
- package/dist/pki/certificate_authority.d.ts +61 -61
- package/dist/pki/certificate_authority.js +481 -481
- package/dist/pki/certificate_manager.d.ts +144 -144
- package/dist/pki/certificate_manager.js +883 -883
- package/dist/pki/certificate_manager.js.map +1 -1
- package/dist/pki/common.d.ts +5 -5
- package/dist/pki/common.js +2 -2
- package/dist/pki/templates/ca_config_template.cnf.d.ts +2 -2
- package/dist/pki/templates/ca_config_template.cnf.js +129 -129
- package/dist/pki/templates/simple_config_template.cnf.d.ts +2 -2
- package/dist/pki/templates/simple_config_template.cnf.js +75 -75
- package/dist/pki/toolbox.d.ts +160 -160
- package/dist/pki/toolbox.js +699 -699
- package/dist/pki/toolbox_pfx.js +18 -18
- package/lib/crypto_create_CA.ts +1135 -1135
- package/lib/index.ts +28 -28
- package/lib/misc/applicationurn.ts +45 -45
- package/lib/misc/hostname.ts +89 -89
- package/lib/misc/install_prerequisite.ts +454 -454
- package/lib/misc/subject.ts +141 -141
- package/lib/pki/certificate_manager.ts +1 -1
- package/lib/pki/common.ts +5 -5
- package/lib/pki/templates/ca_config_template.cnf.ts +129 -129
- package/lib/pki/templates/simple_config_template.cnf.ts +75 -75
- package/lib/pki/toolbox_pfx.ts +19 -19
- package/package.json +89 -89
- package/readme.md +214 -214
- package/tsconfig.json +20 -20
- package/dist/misc/fs.d.ts +0 -24
- package/dist/misc/fs.js +0 -21
- package/dist/misc/fs.js.map +0 -1
- package/dist/misc/get_default_filesystem.d.ts +0 -2
- package/dist/misc/get_default_filesystem.js +0 -9
- package/dist/misc/get_default_filesystem.js.map +0 -1
package/lib/index.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
2
|
-
// node-opcua-pki
|
|
3
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
4
|
-
// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org
|
|
5
|
-
// Copyright (c) 2022 - Sterfive.com
|
|
6
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
7
|
-
//
|
|
8
|
-
// This project is licensed under the terms of the MIT license.
|
|
9
|
-
//
|
|
10
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
11
|
-
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
12
|
-
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
-
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
-
//
|
|
15
|
-
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
16
|
-
// Software.
|
|
17
|
-
//
|
|
18
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
19
|
-
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
-
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
23
|
-
export * from "./pki/toolbox";
|
|
24
|
-
export * from "./pki/certificate_authority";
|
|
25
|
-
export * from "./pki/certificate_manager";
|
|
26
|
-
export * from "./pki/common";
|
|
27
|
-
export * from "./misc/install_prerequisite";
|
|
28
|
-
export * from "./misc/subject";
|
|
1
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// node-opcua-pki
|
|
3
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org
|
|
5
|
+
// Copyright (c) 2022 - Sterfive.com
|
|
6
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
//
|
|
8
|
+
// This project is licensed under the terms of the MIT license.
|
|
9
|
+
//
|
|
10
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
11
|
+
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
12
|
+
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
+
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
16
|
+
// Software.
|
|
17
|
+
//
|
|
18
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
19
|
+
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
+
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
23
|
+
export * from "./pki/toolbox";
|
|
24
|
+
export * from "./pki/certificate_authority";
|
|
25
|
+
export * from "./pki/certificate_manager";
|
|
26
|
+
export * from "./pki/common";
|
|
27
|
+
export * from "./misc/install_prerequisite";
|
|
28
|
+
export * from "./misc/subject";
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
2
|
-
// node-opcua-pki
|
|
3
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
4
|
-
// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org
|
|
5
|
-
// Copyright (c) 2022 - Sterfive.com
|
|
6
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
7
|
-
//
|
|
8
|
-
// This project is licensed under the terms of the MIT license.
|
|
9
|
-
//
|
|
10
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
11
|
-
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
12
|
-
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
-
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
-
//
|
|
15
|
-
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
16
|
-
// Software.
|
|
17
|
-
//
|
|
18
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
19
|
-
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
-
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
23
|
-
import * as assert from "assert";
|
|
24
|
-
import * as crypto from "crypto";
|
|
25
|
-
|
|
26
|
-
export function makeApplicationUrn(hostname: string, suffix: string): string {
|
|
27
|
-
|
|
28
|
-
// beware : Openssl doesn't support urn with length greater than 64 !!
|
|
29
|
-
// sometimes hostname length could be too long ...
|
|
30
|
-
// application urn length must not exceed 64 car. to comply with openssl
|
|
31
|
-
// see cryptoCA
|
|
32
|
-
let hostnameHash = hostname;
|
|
33
|
-
if (hostnameHash.length + 7 + suffix.length >= 64) {
|
|
34
|
-
// we need to reduce the applicationUrn side => let's take
|
|
35
|
-
// a portion of the hostname hash.
|
|
36
|
-
hostnameHash = crypto.createHash("md5")
|
|
37
|
-
.update(hostname)
|
|
38
|
-
.digest("hex")
|
|
39
|
-
.substr(0, 16);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const applicationUrn = "urn:" + hostnameHash + ":" + suffix;
|
|
43
|
-
assert(applicationUrn.length <= 64);
|
|
44
|
-
return applicationUrn;
|
|
45
|
-
}
|
|
1
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
2
|
+
// node-opcua-pki
|
|
3
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org
|
|
5
|
+
// Copyright (c) 2022 - Sterfive.com
|
|
6
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
7
|
+
//
|
|
8
|
+
// This project is licensed under the terms of the MIT license.
|
|
9
|
+
//
|
|
10
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
11
|
+
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
|
12
|
+
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
13
|
+
// permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
|
16
|
+
// Software.
|
|
17
|
+
//
|
|
18
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
19
|
+
// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
+
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
23
|
+
import * as assert from "assert";
|
|
24
|
+
import * as crypto from "crypto";
|
|
25
|
+
|
|
26
|
+
export function makeApplicationUrn(hostname: string, suffix: string): string {
|
|
27
|
+
|
|
28
|
+
// beware : Openssl doesn't support urn with length greater than 64 !!
|
|
29
|
+
// sometimes hostname length could be too long ...
|
|
30
|
+
// application urn length must not exceed 64 car. to comply with openssl
|
|
31
|
+
// see cryptoCA
|
|
32
|
+
let hostnameHash = hostname;
|
|
33
|
+
if (hostnameHash.length + 7 + suffix.length >= 64) {
|
|
34
|
+
// we need to reduce the applicationUrn side => let's take
|
|
35
|
+
// a portion of the hostname hash.
|
|
36
|
+
hostnameHash = crypto.createHash("md5")
|
|
37
|
+
.update(hostname)
|
|
38
|
+
.digest("hex")
|
|
39
|
+
.substr(0, 16);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const applicationUrn = "urn:" + hostnameHash + ":" + suffix;
|
|
43
|
+
assert(applicationUrn.length <= 64);
|
|
44
|
+
return applicationUrn;
|
|
45
|
+
}
|
package/lib/misc/hostname.ts
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-hostname
|
|
3
|
-
*/
|
|
4
|
-
import * as dns from "dns";
|
|
5
|
-
import * as os from "os";
|
|
6
|
-
import { promisify } from "util";
|
|
7
|
-
|
|
8
|
-
function trim(str: string, length?: number): string {
|
|
9
|
-
if (!length) {
|
|
10
|
-
return str;
|
|
11
|
-
}
|
|
12
|
-
return str.substr(0, Math.min(str.length, length));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function fqdn(callback: (err: Error | null, fqdn?: string) => void) {
|
|
16
|
-
const uqdn = os.hostname();
|
|
17
|
-
|
|
18
|
-
dns.lookup(uqdn, { hints: dns.ADDRCONFIG }, (err1: Error | null, ip: string) => {
|
|
19
|
-
if (err1) {
|
|
20
|
-
return callback(err1);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
dns.lookupService(ip, 0, (err2: Error | null, _fqdn: string) => {
|
|
24
|
-
if (err2) {
|
|
25
|
-
return callback(err2);
|
|
26
|
-
}
|
|
27
|
-
_fqdn = _fqdn.replace(".localdomain", "");
|
|
28
|
-
callback(null, _fqdn);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let _fullyQualifiedDomainNameInCache: string | undefined;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* extract FullyQualifiedDomainName of this computer
|
|
37
|
-
*/
|
|
38
|
-
export async function extractFullyQualifiedDomainName(): Promise<string> {
|
|
39
|
-
if (_fullyQualifiedDomainNameInCache) {
|
|
40
|
-
return _fullyQualifiedDomainNameInCache;
|
|
41
|
-
}
|
|
42
|
-
if (process.platform === "win32") {
|
|
43
|
-
// http://serverfault.com/a/73643/251863
|
|
44
|
-
const env = process.env;
|
|
45
|
-
_fullyQualifiedDomainNameInCache =
|
|
46
|
-
env.COMPUTERNAME + (env.USERDNSDOMAIN && env.USERDNSDOMAIN!.length > 0 ? "." + env.USERDNSDOMAIN! : "");
|
|
47
|
-
} else {
|
|
48
|
-
try {
|
|
49
|
-
_fullyQualifiedDomainNameInCache = await promisify(fqdn)();
|
|
50
|
-
if (_fullyQualifiedDomainNameInCache === "localhost") {
|
|
51
|
-
throw new Error("localhost not expected");
|
|
52
|
-
}
|
|
53
|
-
if (/sethostname/.test(_fullyQualifiedDomainNameInCache as string)) {
|
|
54
|
-
throw new Error("Detecting fqdn on windows !!!");
|
|
55
|
-
}
|
|
56
|
-
} catch (err) {
|
|
57
|
-
// fall back to old method
|
|
58
|
-
_fullyQualifiedDomainNameInCache = os.hostname();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return _fullyQualifiedDomainNameInCache!;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export async function prepareFQDN() {
|
|
65
|
-
_fullyQualifiedDomainNameInCache = await extractFullyQualifiedDomainName();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function getFullyQualifiedDomainName(optional_max_length?: number) {
|
|
69
|
-
if (!_fullyQualifiedDomainNameInCache) {
|
|
70
|
-
throw new Error("FullyQualifiedDomainName computation is not completed yet");
|
|
71
|
-
}
|
|
72
|
-
return _fullyQualifiedDomainNameInCache ? trim(_fullyQualifiedDomainNameInCache, optional_max_length) : "%FQDN%";
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function getHostname() {
|
|
76
|
-
return os.hostname();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function resolveFullyQualifiedDomainName(str: string): string {
|
|
80
|
-
if (!_fullyQualifiedDomainNameInCache) {
|
|
81
|
-
throw new Error("FullyQualifiedDomainName computation is not completed yet");
|
|
82
|
-
}
|
|
83
|
-
str = str.replace("%FQDN%", _fullyQualifiedDomainNameInCache);
|
|
84
|
-
str = str.replace("{FQDN}", _fullyQualifiedDomainNameInCache);
|
|
85
|
-
str = str.replace("{hostname}", getHostname());
|
|
86
|
-
return str;
|
|
87
|
-
}
|
|
88
|
-
// note : under windows ... echo %COMPUTERNAME%.%USERDNSDOMAIN%
|
|
89
|
-
prepareFQDN();
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-hostname
|
|
3
|
+
*/
|
|
4
|
+
import * as dns from "dns";
|
|
5
|
+
import * as os from "os";
|
|
6
|
+
import { promisify } from "util";
|
|
7
|
+
|
|
8
|
+
function trim(str: string, length?: number): string {
|
|
9
|
+
if (!length) {
|
|
10
|
+
return str;
|
|
11
|
+
}
|
|
12
|
+
return str.substr(0, Math.min(str.length, length));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function fqdn(callback: (err: Error | null, fqdn?: string) => void) {
|
|
16
|
+
const uqdn = os.hostname();
|
|
17
|
+
|
|
18
|
+
dns.lookup(uqdn, { hints: dns.ADDRCONFIG }, (err1: Error | null, ip: string) => {
|
|
19
|
+
if (err1) {
|
|
20
|
+
return callback(err1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
dns.lookupService(ip, 0, (err2: Error | null, _fqdn: string) => {
|
|
24
|
+
if (err2) {
|
|
25
|
+
return callback(err2);
|
|
26
|
+
}
|
|
27
|
+
_fqdn = _fqdn.replace(".localdomain", "");
|
|
28
|
+
callback(null, _fqdn);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let _fullyQualifiedDomainNameInCache: string | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* extract FullyQualifiedDomainName of this computer
|
|
37
|
+
*/
|
|
38
|
+
export async function extractFullyQualifiedDomainName(): Promise<string> {
|
|
39
|
+
if (_fullyQualifiedDomainNameInCache) {
|
|
40
|
+
return _fullyQualifiedDomainNameInCache;
|
|
41
|
+
}
|
|
42
|
+
if (process.platform === "win32") {
|
|
43
|
+
// http://serverfault.com/a/73643/251863
|
|
44
|
+
const env = process.env;
|
|
45
|
+
_fullyQualifiedDomainNameInCache =
|
|
46
|
+
env.COMPUTERNAME + (env.USERDNSDOMAIN && env.USERDNSDOMAIN!.length > 0 ? "." + env.USERDNSDOMAIN! : "");
|
|
47
|
+
} else {
|
|
48
|
+
try {
|
|
49
|
+
_fullyQualifiedDomainNameInCache = await promisify(fqdn)();
|
|
50
|
+
if (_fullyQualifiedDomainNameInCache === "localhost") {
|
|
51
|
+
throw new Error("localhost not expected");
|
|
52
|
+
}
|
|
53
|
+
if (/sethostname/.test(_fullyQualifiedDomainNameInCache as string)) {
|
|
54
|
+
throw new Error("Detecting fqdn on windows !!!");
|
|
55
|
+
}
|
|
56
|
+
} catch (err) {
|
|
57
|
+
// fall back to old method
|
|
58
|
+
_fullyQualifiedDomainNameInCache = os.hostname();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return _fullyQualifiedDomainNameInCache!;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function prepareFQDN() {
|
|
65
|
+
_fullyQualifiedDomainNameInCache = await extractFullyQualifiedDomainName();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getFullyQualifiedDomainName(optional_max_length?: number) {
|
|
69
|
+
if (!_fullyQualifiedDomainNameInCache) {
|
|
70
|
+
throw new Error("FullyQualifiedDomainName computation is not completed yet");
|
|
71
|
+
}
|
|
72
|
+
return _fullyQualifiedDomainNameInCache ? trim(_fullyQualifiedDomainNameInCache, optional_max_length) : "%FQDN%";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getHostname() {
|
|
76
|
+
return os.hostname();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function resolveFullyQualifiedDomainName(str: string): string {
|
|
80
|
+
if (!_fullyQualifiedDomainNameInCache) {
|
|
81
|
+
throw new Error("FullyQualifiedDomainName computation is not completed yet");
|
|
82
|
+
}
|
|
83
|
+
str = str.replace("%FQDN%", _fullyQualifiedDomainNameInCache);
|
|
84
|
+
str = str.replace("{FQDN}", _fullyQualifiedDomainNameInCache);
|
|
85
|
+
str = str.replace("{hostname}", getHostname());
|
|
86
|
+
return str;
|
|
87
|
+
}
|
|
88
|
+
// note : under windows ... echo %COMPUTERNAME%.%USERDNSDOMAIN%
|
|
89
|
+
prepareFQDN();
|