Programmable Voice

  1. Home
  2. Docs
  3. Programmable Voice
  4. WebRTC
  5. 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

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 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>

 

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@voiceelements.com 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? Yes 5 No

How can we help?