Commit a186bf5
fix(tls): allow TLS 1.2 for S7-1500 PLCs (#760)
The TLS context forced minimum_version to TLS 1.3, but S7-1500 PLCs
with firmware < V3.0 (e.g. 1512SP-1 FW V4.1.2) only support TLS 1.2.
The ClientHello offered only TLS 1.3 cipher suites and versions, so the
PLC rejected the connection with a TCP RST.
Lower the minimum to TLS 1.2 so Python's ssl module auto-negotiates the
highest mutually-supported version.
Also surface the CreateObject return value: when non-zero the PLC is
rejecting the session (typically because TLS is required), but the old
code silently fell through to the misleading "V1-initial SessionKey"
warning.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7637ab2 commit a186bf5
3 files changed
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
824 | | - | |
| 824 | + | |
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
831 | 834 | | |
832 | 835 | | |
833 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
| 621 | + | |
622 | 622 | | |
623 | | - | |
| 623 | + | |
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | | - | |
| 762 | + | |
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
781 | 784 | | |
782 | 785 | | |
783 | 786 | | |
| |||
1020 | 1023 | | |
1021 | 1024 | | |
1022 | 1025 | | |
1023 | | - | |
| 1026 | + | |
| 1027 | + | |
1024 | 1028 | | |
1025 | | - | |
1026 | 1029 | | |
1027 | 1030 | | |
1028 | | - | |
1029 | 1031 | | |
1030 | 1032 | | |
1031 | 1033 | | |
| |||
0 commit comments