Search code examples
deepstream.io

Is it possible to use mutual TLS with deepstream.io?


I'd be interested in using mutual TLS between deepstream.io server and deepstream.io-client-js clients. I know deepstream.io's tutorials mention leaving SSL termination to a load balancer like Nginx or HAproxy, but how do I use deepstream.io client to give the appropriate client certificate?


Solution

  • After some research I found that you can construct the client with options and one of the options is called nodeSocketOptions. This object is used when constructing the underlying websocket, so here you can give it the cert, ca and key, thus enabling mutual tls from client side.

    const deepstream = require('deepstream.io-client-js'); 
    const client = deepstream('localhost:6020', options).login();