Disable TLS

Showing JavaScript examples.

Disable TLS when you need to capture unencrypted TCP traffic for debugging in a development environment. PubNub SDKs connect over TLS 1.2 by default, except the Lua SDK and the unsupported Twisted SDK, where you set ssl to true. It should stay enabled in production.

Before you start​

Confirm you have:

  • A PubNub keyset with publish and subscribe keys from Admin Portal.
  • A development or testing environment. Do not disable TLS in production.
SSL parameter name

Some PubNub SDKs use ssl as the parameter name. This is a legacy name for TLS. SSL v3 was deprecated after a security vulnerability and replaced by TLS, but the parameter name was not updated in all SDKs.

Disable TLS in SDK initialization​

Set the TLS/SSL configuration option to false when creating the PubNub instance.

1var pubnub = new PubNub({
2 subscribeKey: "mySubscribeKey",
3 publishKey: "myPublishKey",
4 userId: "myUniqueUserId",
5 ssl: false // default 'true'
6});

When to disable TLS​

Disable TLS only for capturing TCP traffic (for example, a tcpdump to a .pcap file) to analyze and debug network communication issues in a development environment. Re-enable TLS before deploying to production.

Was this page useful?

Last updated on