Browse Source

Fix #202, check if ssl is defined

pull/206/head
butlerx 5 years ago
parent
commit
d1584354d5
No known key found for this signature in database GPG Key ID: B37CA765BAA89170
  1. 2
      package.json
  2. 2
      src/server/ssl.ts

2
package.json

@ -1,6 +1,6 @@
{
"name": "wetty",
"version": "1.1.6",
"version": "1.1.7",
"description": "WeTTY = Web + TTY. Terminal access in browser over http/https",
"homepage": "https://github.com/krishnasrinivas/wetty",
"repository": {

2
src/server/ssl.ts

@ -4,7 +4,7 @@ import { isUndefined } from 'lodash';
import { SSL, SSLBuffer } from './interfaces';
export default async function loadSSL(ssl: SSL): Promise<SSLBuffer> {
if (isUndefined(ssl.key) || isUndefined(ssl.cert)) return {};
if (isUndefined(ssl) || isUndefined(ssl.key) || isUndefined(ssl.cert)) return {};
const files = [readFile(resolve(ssl.key)), readFile(resolve(ssl.cert))];
const [key, cert]: Buffer[] = await Promise.all(files);
return { key, cert };

Loading…
Cancel
Save