Metadata-Version: 2.5
Name: ibgw-tls
Version: 26.0.1
Summary: Wrap TCP connection between ib_async and IBKR TWS/IBGW in TLS with mutual authentication.
Author-email: Stefan Kornexl <mail@kornexl.com>
Requires-Python: >=3.10
Requires-Dist: ib-async>=2.0.1
Requires-Dist: ipykernel>=7.1.0
Requires-Dist: omegaconf>=2.3.0
Requires-Dist: pandas>=2.3.3
Requires-Dist: typer>=0.20.0
Description-Content-Type: text/markdown

# Purpose

Encrypted and Authenticated transport between Python clients using ib_async and IBKR TWS/IBGW.

The `gw` is essentially a TLS-termination proxy. `ib_async` extends the original for TLS. `ping` is a minimal tester client (TLS configurable).


# Synopsis

Create sample certificates:

    cd sample_confs/
    ./easy-rsa.sh

in `sample_confs/`, run gateway:

    python -m ibgw_tls.gw -c gw.yml run

in `sample_confs/`, run ping:

    python -m ibgw_tls.ping -c ping_use_ssl.yml ping

ping without TLS:

    python -m ibgw_tls.ping -o port=7497 ping


# Python development client side 

## patch asyncio loop create_connection

See tb src/tb/ibcon.py IBCon.connect()

This is now preferred, it does not require patching ib_async and should make upgrades much easier.

## using ibgw_tls.ib_async

Instead of `ib_async`, import from `ibgw_tls.ib_async` and supply `sslCtx: SSLContext` to IB.connect:

    from ibgw_tls.ib_async import IB
    ...
    ib.connect(host="localhost", port=57497, sslCtx=ssl_ctx)

Full example including TLS configuration in `src/example/client.py`.
