testing ssl stuff (doesnt do anything yet)
This commit is contained in:
BIN
zefie_wtvp_minisrv/includes/ServiceDeps/https/ca.der
Normal file
BIN
zefie_wtvp_minisrv/includes/ServiceDeps/https/ca.der
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
header = `200 OK
|
||||
Content-type: wtv/ssl-certs`
|
||||
|
||||
data = wtvssl.getCACert();
|
||||
@@ -134,6 +134,8 @@ wtv-messenger-enable: 0
|
||||
|
||||
headers += `wtv-log-url: wtv-log:/log
|
||||
wtv-ssl-log-url: wtv-log:/log
|
||||
wtv-ssl-certs-download-url: wtv-head-waiter:/download-ssl-certs
|
||||
wtv-ssl-certs-checksum: 9BD865819765B66A2756F98FB4EEFBD4
|
||||
`;
|
||||
|
||||
if (!limitedLogin && !limitedLoginRegistered) {
|
||||
|
||||
18
zefie_wtvp_minisrv/includes/classes/WTVSSL.js
Normal file
18
zefie_wtvp_minisrv/includes/classes/WTVSSL.js
Normal file
@@ -0,0 +1,18 @@
|
||||
class WTVSSL {
|
||||
wtvshared = null;
|
||||
constructor() {
|
||||
const WTVShared = require("./WTVShared.js")['WTVShared'];
|
||||
this.wtvshared = new WTVShared();
|
||||
}
|
||||
|
||||
getCACert() {
|
||||
// return the CA cert
|
||||
const caCertFile = this.wtvshared.getServiceDep("https/ca.der")
|
||||
if (!this.wtvshared.fs.existsSync(caCertFile)) {
|
||||
throw new Error("CA certificate file not found");
|
||||
}
|
||||
return this.wtvshared.fs.readFileSync(caCertFile);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WTVSSL;
|
||||
Reference in New Issue
Block a user