Skip to content

Commit

Permalink
chore: update certificates resource
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Nov 17, 2024
1 parent 8206439 commit dae2106
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions lib/certificates.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import Interval from "#lib/interval";

const resource = await externalResources.add( "softvisio-node/core/resources/certificates" ).check();

const defaultHttpsDomain = "local.softvisio.net",
defaultHttpsCertificate = `${ resource.location }/${ defaultHttpsDomain }/certificate.pem`,
defaultHttpsPrivateKey = `${ resource.location }/${ defaultHttpsDomain }/private-key.pem`;
const defaultTlsDomain = "local.softvisio.net",
defaultTlsCertificate = `${ resource.location }/${ defaultTlsDomain }/certificate.pem`,
defaultTlsPrivateKey = `${ resource.location }/${ defaultTlsDomain }/private-key.pem`;

const DEFAULT_PRIVATE_KEY_SIZE = 4096;

class Certificates {

// properties
get defaultHttpsDomain () {
return defaultHttpsDomain;
get defaultTlsDomain () {
return defaultTlsDomain;
}

get defaultHttpsCertificate () {
return defaultHttpsCertificate;
get defaultTlsCertificate () {
return defaultTlsCertificate;
}

get defaultHttpsPrivateKey () {
return defaultHttpsPrivateKey;
get defaultTlsPrivateKey () {
return defaultTlsPrivateKey;
}

// public
Expand Down
6 changes: 3 additions & 3 deletions resources/external-resources-sources/build-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async function getHeaders ( browser, protocol, headless = false ) {

server = new Server( {
"ssl": protocol === "https:",
"cert_file_name": certificates.defaultHttpsCertificate,
"key_file_name": certificates.defaultHttpsPrivateKey,
"cert_file_name": certificates.defaultTlsCertificate,
"key_file_name": certificates.defaultTlsPrivateKey,
} ).get( "/*", async req => {
await req.end();

Expand All @@ -50,7 +50,7 @@ async function getHeaders ( browser, protocol, headless = false ) {
server.start( { "port": 0 } ).then( async res => {
if ( !res.ok ) throw res + "";

const url = `${ protocol }//${ certificates.defaultHttpsDomain }:${ res.data.port }/`;
const url = `${ protocol }//${ certificates.defaultTlsDomain }:${ res.data.port }/`;

browser = new Browser( url, {
browser,
Expand Down

0 comments on commit dae2106

Please sign in to comment.