I think the new HTTP implementation is basically working, now.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4707 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
14
core/core.js
14
core/core.js
@ -1006,6 +1006,20 @@ loadSettings().then(function() {
|
||||
}
|
||||
});
|
||||
httpd_impl.start(tildefriends.http_port);
|
||||
|
||||
if (tildefriends.args.httpdc && tildefriends.https_port) {
|
||||
async function start_tls() {
|
||||
const kCertificatePath = "data/httpd/certificate.pem";
|
||||
const kPrivateKeyPath = "data/httpd/privatekey.pem";
|
||||
let privateKey = utf8Decode(await File.readFile(kPrivateKeyPath));
|
||||
let certificate = utf8Decode(await File.readFile(kCertificatePath));
|
||||
let context = new TlsContext();
|
||||
context.setPrivateKey(privateKey);
|
||||
context.setCertificate(certificate);
|
||||
httpd_impl.start(tildefriends.https_port, context);
|
||||
}
|
||||
start_tls();
|
||||
}
|
||||
}).catch(function(error) {
|
||||
print('Failed to load settings.');
|
||||
printError({print: print}, error);
|
||||
|
Reference in New Issue
Block a user