Skip to content

Add TLS support to S7CommPlus async client#656

Merged
gijzelaerr merged 2 commits intomasterfrom
async-s7commplus-tls
Mar 25, 2026
Merged

Add TLS support to S7CommPlus async client#656
gijzelaerr merged 2 commits intomasterfrom
async-s7commplus-tls

Conversation

@gijzelaerr
Copy link
Copy Markdown
Owner

Summary

  • Implement TLS 1.3 for S7CommPlusAsyncClient, bringing feature parity with the sync S7CommPlusConnection for V2 protocol connections
  • Add use_tls, tls_cert, tls_key, tls_ca keyword arguments to connect()
  • Implement _activate_tls() using asyncio.start_tls() for in-place transport upgrade
  • Add authenticate() method with full legitimation support (legacy SHA-1 XOR and new AES-256-CBC)
  • V2 connections now require TLS and automatically enable IntegrityId tracking
  • Fix TLS 1.3 cipher configuration for Python 3.13+ compatibility (affects both sync and async)

Test plan

  • 10 new tests in test_async_tls.py (preconditions, V2 without TLS, V2 with TLS against emulated server)
  • Full suite passes (1300 passed, 78 skipped)
  • mypy clean (64 files)
  • ruff clean

🤖 Generated with Claude Code

gijzelaerr and others added 2 commits March 25, 2026 11:33
Implement TLS 1.3 for S7CommPlusAsyncClient, bringing feature parity
with the sync S7CommPlusConnection for V2 protocol connections:

- Add use_tls, tls_cert, tls_key, tls_ca parameters to connect()
- Implement _activate_tls() using asyncio start_tls() for in-place
  transport upgrade
- Add authenticate() method with full legitimation support (legacy
  SHA-1 XOR and new AES-256-CBC modes)
- Add V2 post-connection checks (require TLS, enable IntegrityId)
- Reset TLS state on disconnect
- Fix TLS 1.3 cipher configuration for Python 3.13+ compatibility
  (use set_ciphersuites instead of set_ciphers for TLS 1.3)

The cipher fix also applies to the sync connection.py to prevent the
same issue on Python 3.14+.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gijzelaerr gijzelaerr force-pushed the async-s7commplus-tls branch from c43b473 to 3a990a8 Compare March 25, 2026 09:33
@gijzelaerr gijzelaerr merged commit 2c94acf into master Mar 25, 2026
37 checks passed
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.

1 participant