Setting up Secure WebSockets

⌘K
  1. Home
  2. Programmable Voice
  3. WebRTC
  4. Setting up Secure WebSockets

Setting up Secure WebSockets

By default the Voice Elements Platform is setup to use a non-encrypted web socket. This allows you to develop applications rapidly and test them without difficulty. However, at some point, you may wish to secure the web socket connection between your browser and your server.

Note: This section deals with securing your web socket. DTLS setup and security is covered in another topic here: WebRTC – How to Configure

Find WebRTCSockets in the Config File

In the configuration section of HMP Elements (HMPElementsServer.exe.config) locate this section:

    <setting name="WebRtcSockets" serializeAs="Xml">
     <value>
      <WebRtcSockets>
       <WebRtcSocket>
        <Id>Unsecure</Id>
        <SocketIp>172.18.13.145</SocketIp>
        <SocketPort>1337</SocketPort>
        <CertificateFile></CertificateFile>
        <Password></Password>
        <Encrypted>0</Encrypted>
        <MaxConnections>100</MaxConnections>
       </WebRtcSocket>
      </WebRtcSockets>
     </value>
    </setting>

 

Add a New WebRTCSocket Item

Add a new WebRtcSocket item to the collection like this:

    <setting name="WebRtcSockets" serializeAs="Xml">
     <value>
      <WebRtcSockets>
       <WebRtcSocket>
        <Id>Unsecure</Id>
        <SocketIp>172.18.13.145</SocketIp>
        <SocketPort>1337</SocketPort>
        <CertificateFile></CertificateFile>
        <Password></Password>
        <Encrypted>0</Encrypted>
        <MaxConnections>100</MaxConnections>
       </WebRtcSocket>
       <WebRtcSocket>
        <Id>Secure</Id>
        <SocketIp>172.18.13.145</SocketIp>
        <SocketPort>1338</SocketPort>
        <CertificateFile>C:\PathToPFX\labpccert.pfx</CertificateFile>
        <Password>yourPassword</Password>
        <Encrypted>0</Encrypted>
        <MaxConnections>100</MaxConnections>
       </WebRtcSocket>
      </WebRtcSockets>
     </value>
    </setting>

 

CertificateFile Format

The CertificateFile must be in PFX format. If you need to convert your certificate to PFX see: WebRTC – Creating a Self Signed Certificate

The Password is the password that will decrypt the private key of the certificate.

If you don’t wish this to be seen in plain text you can use the Password Encryptor. Send a note to Support and we can give you a link. If you decide to encrypt the password, you must set the Encrypted flag to 1 (one).

Was this article helpful to you? No Yes 13

How can we help?