diff --git a/src/index.js b/src/index.js index b418c37..235cf8a 100644 --- a/src/index.js +++ b/src/index.js @@ -63,8 +63,9 @@ class SocketServer extends EventEmitter { socket.host = socket.origin; } + if (!await self.acme.checkCertificate(socket.host, organization_id)) + return socket.send(JSON.stringify({ method: 'Access Denied', error: 'Host not whitelisted' })) - // TODO: handle ssl validation here and creation here if (!organization || organization && organization.status !== false) { let data = { socket,