Oninit® MySQL-2-Informix — Configuration
cfg/ifx.conf
The proxy reads a single configuration file at start-up describing how to reach the Informix backend, which database to connect to by default, and the license key that authorises the binary on this host. The file is plain key=value:
host=192.168.69.42 port=9089 server=your_server database=sysmaster user=informix password=secret auth_user=alice:<40 hex: SHA1(SHA1(password))> auth_grant=alice:rw:sales license_key=ONINIT-acmecorp-20270401-<signature>
At least one auth_user is required: MySQL clients must log in to the proxy, and with none configured it refuses to start.
Field reference
| Key | Meaning |
|---|---|
| host | Informix server hostname or IP address. |
| port | TCP port the IDS instance listens on (matches the relevant sqlhosts entry on the IDS host). |
| server | Informix server name — the INFORMIXSERVER value the backend resolves through sqlhosts. |
| database | Default database to connect to. Clients can switch databases at any time with USE <dbname> or by passing --database=<dbname> on the connect string. |
| user | Informix user the proxy authenticates as. |
| password | Password for that user. Stored in plaintext in the file — protect with filesystem permissions. |
| license_key | The Oninit-issued license key. Validated at start-up by the in-tree pure-C HMAC-SHA256 check; binding includes the customer name and an expiry date. |
| auth_user | A client login, as name:SHA1(SHA1(password)) — the hash MySQL itself keeps. One line per account, up to 16. Generate it with make passwd && ./m2i_passwd <name>. A malformed entry stops start-up. |
| auth_grant | user:role[:db,db,...|*]. Roles are ro (SELECT, SHOW, DESCRIBE, EXPLAIN, USE), rw (adds INSERT/UPDATE/DELETE and table, index, view and trigger DDL) and admin (everything else; CREATE/DROP DATABASE needs admin:*). The database list limits what the account may use or reference; omitted means the configured database only. An account with no grant is read-only on that database. This is a proxy-level control, not a replacement for least privilege on the Informix account. |
| auth_mode | none turns client login off. For local development only: any client that can reach the listener then runs SQL as the backend account. |
| hard_max_threads, idle_timeout, read_timeout, write_timeout | Resource bounds. hard_max_threads (default 1024) caps concurrent sessions and a license cannot lift it. idle_timeout (default 8 hours), read_timeout (30 s) and write_timeout (60 s) drop stalled clients; 0 means no deadline. |
| max_result_mb, max_result_total_mb | Memory budget for a SELECT, which is buffered before it is sent: per result set (default 256 MiB) and across all concurrent results (default 1024 MiB). A query over budget fails with an error rather than returning a truncated result. 0 means unlimited. |
| ifx_tls, ifx_tls_verify, ifx_tls_ca, ifx_tls_server_name, ifx_tls_cert, ifx_tls_key | TLS to Informix (m2is). Required by default, with the server certificate and hostname verified; if it cannot be established no login is sent. The Informix listener must be an SSL one (onsocssl). Set ifx_tls_server_name when host is an IP address. ifx_tls=off and ifx_tls_verify=no are insecure opt-outs. |
Listen address
The proxy binds 127.0.0.1:3307 by default. Override the port with M2I_PORT in the environment before ./m2i start:
M2I_PORT=3308 ./m2i start
Both backends can run side by side on different ports — different binaries write different PID files, so there is no clobber.
Picking the backend at runtime
The m2i control script defaults to ./m2ie. To run the SQLI backend instead, point M2I_BINARY at ./m2is before invoking start / stop / status:
M2I_BINARY=./m2is ./m2i start M2I_BINARY=./m2is ./m2i status M2I_BINARY=./m2is ./m2i stop
The PID file follows the binary name, so an m2ie instance and an m2is instance on different ports manage independently.
Environment for m2ie
The ESQL backend needs the Informix CSDK at runtime:
export INFORMIXDIR=/path/to/informix-csdk export LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH export INFORMIXSQLHOSTS=/path/to/sqlhosts export INFORMIXSERVER=your_server
m2is needs none of these — it speaks SQLI directly over TCP and resolves host / port from the config file.
Operational notes
- An m2is built with TLS=0 refuses to start unless ifx_tls=off.
- The config file is read once at start-up. Edit and restart the proxy to pick up changes.
- Don't commit a real license_key or production credentials to source control. The repository deliberately gitignores customer config.
- The license-key generator holds the signing secret and is built separately from the proxy. The proxy itself only carries the public verification path.