mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 03:53:08 +00:00
clientCertificate: remove unsafe casts
This commit is contained in:
parent
a4afa08add
commit
b8a9fe08ab
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ function get(uuid: string): ClientCertificateType | null {
|
|||
return {
|
||||
private_key: fs.readFileSync(paths.privateKeyPath, "utf-8"),
|
||||
certificate: fs.readFileSync(paths.certificatePath, "utf-8"),
|
||||
} as ClientCertificateType;
|
||||
};
|
||||
} catch (e: any) {
|
||||
log.error("Unable to get certificate", e);
|
||||
}
|
||||
|
@ -122,10 +122,10 @@ function generate() {
|
|||
// Sign this certificate with a SHA256 signature
|
||||
cert.sign(keys.privateKey, md.sha256.create());
|
||||
|
||||
const pem = {
|
||||
const pem: ClientCertificateType = {
|
||||
private_key: pki.privateKeyToPem(keys.privateKey),
|
||||
certificate: pki.certificateToPem(cert),
|
||||
} as ClientCertificateType;
|
||||
};
|
||||
|
||||
return pem;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue