---
source_url: https://www.pubnub.com/docs/security/encryption/disable-tls
title: Disable TLS
description: Turn off TLS encryption during SDK initialization for development or debugging.
updated_at: 2026-09-30T07:20:08.000Z
---

# Disable TLS

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

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](https://admin.pubnub.com/).
* A development or testing environment. Do not disable TLS in production.

:::note 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.

### JavaScript

```javascript
var pubnub = new PubNub({
    subscribeKey: "mySubscribeKey",
    publishKey: "myPublishKey",
    userId: "myUniqueUserId",
    ssl: false // default 'true'
});
```

### Swift

```swift
import PubNubSDK

let config = PubNubConfiguration(
  publishKey: "demo",
  subscribeKey: "demo",
  userId: "myUniqueUserId",
  useSecureConnections: false // default true
)

let pubnub = PubNub(configuration: config)
```

### Objective-C

```objectivec
PNConfiguration *pnconfig = [PNConfiguration configurationWithPublishKey:@"myPublishKey"
                                             subscribeKey:@"mySubscribeKey"];

pnconfig.uuid = "theClientUUID"
pnconfig.TLSEnabled = NO; // default YES
self.client = [PubNub clientWithConfiguration:pnconfig];
```

### Java

```java
PNConfiguration.Builder configBuilder = PNConfiguration.builder(new UserId("yourUserId"), "yourSubscribeKey");
configBuilder.publishKey("PublishKey");
configBuilder.secure(false);
PubNub pubNub = PubNub.create(configBuilder.build());
```

### C#

```csharp
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"));
pnConfiguration.PublishKey = "myPublishKey";
pnConfiguration.SubscribeKey = "mySubscribeKey";
pnConfiguration.Secure = false;  // default true

Pubnub pubnub = new Pubnub(pnConfiguration);
```

### Python

```python
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub

pnconfig = PNConfiguration()
pnconfig.publish_key = "myPublishKey"
pnconfig.subscribe_key = "mySubscribeKey"
pnconfig.user_id = "myUserID"
pnconfig.ssl = False # default True

pubnub = PubNub(pnconfig)
```

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

## Related pages

* [Data security and encryption](https://www.pubnub.com/docs/security/encryption/overview.md). How TLS and content encryption work together.

Last updated at: 2026-09-30T07:20:08.000Z
