Subclass of socket with optional TLS
You don't need a class here, a simple function will do:

import ssl
from socket import socket

def testsock(tls=True):
    sock = socket()
    sock.connect(('192.168.0.1', 443))
    if tls:
        sock = ssl.wrap_socket(sock)
    return sock

testsock(tls=True)


Returned objects are either plain sockets or ssl sockets but they share some common behaviour (like send or recv). If you need to add attributes, you can do that before the return statement.

In case you wish to be able to extend it better, you can still use the socket as an attribute on a custom class and expose the socket API through __getattr__:

class TestSock(object):
    def __init__(self, tls=True):
        sock = socket()
        sock.connect(('192.168.0.1', 443))
        if tls:
            sock = ssl.wrap_socket(sock)
        self.socket = sock
        # other attributes

    def __getattr__(self, attribute_name):
        """Defer unknown behaviour to the socket"""
        return getattr(self.socket, attribute_name)

    # other methods


But you don't need it for now.