Skip to content

Add SSL host verification and insecure skip verify CLI flags - #77

Merged
digiserg merged 3 commits into
mainfrom
feat/ssl-validation
Apr 10, 2026
Merged

Add SSL host verification and insecure skip verify CLI flags#77
digiserg merged 3 commits into
mainfrom
feat/ssl-validation

Conversation

@digiserg

@digiserg digiserg commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add `--no-ssl-host-verification` CLI flag to disable SSL hostname verification (env: `CQLAI_NO_SSL_HOST_VERIFICATION`)
  • Add `--ssl-insecure-skip-verify` CLI flag to skip SSL certificate verification, useful when connecting to hosts without proper IP SANs (env: `CQLAI_SSL_INSECURE_SKIP_VERIFY`)
  • Both flags override the corresponding `ssl.hostVerification` and `ssl.insecureSkipVerify` options from the config file
  • CLI flags take precedence over env vars, which take precedence over the config file; leaving a flag unset preserves the config value
  • Applies to both interactive and batch mode

Test plan

  • Run with `--no-ssl-host-verification` and verify `HostVerification=false` is passed to the session
  • Run with `--ssl-insecure-skip-verify` and verify `InsecureSkipVerify=true` is passed to the session, bypassing cert validation
  • Set `CQLAI_NO_SSL_HOST_VERIFICATION=true` and verify it applies when flag is not set
  • Set `CQLAI_SSL_INSECURE_SKIP_VERIFY=true` and verify it applies when flag is not set
  • Confirm that omitting both flags leaves the config file values unchanged
  • Verify both flags work in batch mode (`-e` / `-f`)

@digiserg
digiserg force-pushed the feat/ssl-validation branch from 6333549 to 12135eb Compare April 10, 2026 08:07
…flags

Expose the SSL hostVerification and insecureSkipVerify config options via
CLI flags and environment variables (CQLAI_NO_SSL_HOST_VERIFICATION,
CQLAI_NO_SSL_INSECURE_SKIP_VERIFY). CLI flags take precedence over env vars,
which take precedence over the config file.
@digiserg
digiserg force-pushed the feat/ssl-validation branch from 12135eb to 98226a8 Compare April 10, 2026 08:10
@digiserg digiserg changed the title Add --no-ssl-host-verification and --no-ssl-insecure-skip-verify CLI flags Add SSL host verification and insecure skip verify CLI flags Apr 10, 2026
…verify flags

Godog feature file and step definitions covering: flag overrides config,
env var applies when flag is unset, CLI flag takes precedence over env var,
and nil-pointer semantics when neither is set.
Python's cqlsh writes True/False with capital letters. Our comparisons
were case-sensitive so 'ssl = True' never enabled SSL from [connection],
and 'validate = False' fell into the else branch and incorrectly set
HostVerification=true instead of InsecureSkipVerify=true. Fix by using
strings.ToLower before comparing boolean values in loadCQLSHRC.
@digiserg
digiserg merged commit b0c96e8 into main Apr 10, 2026
14 checks passed
@digiserg
digiserg deleted the feat/ssl-validation branch April 10, 2026 09:13
hshimizu pushed a commit that referenced this pull request May 14, 2026
* Add --no-ssl-host-verification and --no-ssl-insecure-skip-verify CLI flags

Expose the SSL hostVerification and insecureSkipVerify config options via
CLI flags and environment variables (CQLAI_NO_SSL_HOST_VERIFICATION,
CQLAI_NO_SSL_INSECURE_SKIP_VERIFY). CLI flags take precedence over env vars,
which take precedence over the config file.

* Add BDD tests for --no-ssl-host-verification and --ssl-insecure-skip-verify flags

Godog feature file and step definitions covering: flag overrides config,
env var applies when flag is unset, CLI flag takes precedence over env var,
and nil-pointer semantics when neither is set.

* Fix cqlshrc SSL boolean values not being parsed case-insensitively

Python's cqlsh writes True/False with capital letters. Our comparisons
were case-sensitive so 'ssl = True' never enabled SSL from [connection],
and 'validate = False' fell into the else branch and incorrectly set
HostVerification=true instead of InsecureSkipVerify=true. Fix by using
strings.ToLower before comparing boolean values in loadCQLSHRC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants