TECH: SslScanner Improvement — Fix IMAP STARTTLS protocol in Test_SSL_Support#10
TECH: SslScanner Improvement — Fix IMAP STARTTLS protocol in Test_SSL_Support#10EvoJocys wants to merge 1 commit into
Conversation
… in Test_SSL_Support
The IMAP branch (port == 143) in Tool/Common/Test_SSL_Support.cs was a
verbatim copy of the POP3 branch — it expected a POP3 '+OK' greeting and
sent the POP3 'STLS' command. RFC 3501 servers greet with '* OK' and
RFC 2595 STARTTLS uses a tagged 'STARTTLS' command, so every IMAP scan
on port 143 unconditionally threw InvalidOperationException.
- Test_SSL_Support.cs: greeting check '+OK' -> '* OK'; command 'STLS' ->
'a001 STARTTLS'; reply check matches ' OK' anywhere on the line so
tagged responses ('a001 OK Begin TLS') are accepted; error strings
updated to say STARTTLS.
- JocysCom.SslScanner.Tool.csproj: 1.1.6 -> 1.1.7.
- ChangeLog.txt: prepend dated v1.1.7 entry.
- .ai/work-item-improvement.md: flip WI-1 [Working] -> [Done].
Implements WI-1. Closes #8.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
🤖 AI-Assisted Review [AI Review]🟢 Risk: Low — single contained protocol fix, no security/data impact Decision✅ Approve with comments Why: Correctly replaces POP3 wire format on the IMAP branch with RFC-conformant greeting and tagged STARTTLS; only minor tightening of the success check is suggested. Related
Blockers
SuggestionsSuggestion 1 · 🟡 RecommendedFile: Tool/Common/Test_SSL_Support.cs Reason: Suggestion 2 · ⚪ OptionalFile: Tool/Common/Test_SSL_Support.cs Reason: An IMAP server may legitimately greet with Suggestion 3 · ⚪ OptionalFile: Tool/Common/Test_SSL_Support.cs Reason: Many real IMAP servers emit untagged status lines ( How it worksThe IMAP branch in This PR replaces those two checks: the greeting test becomes sequenceDiagram
participant S as Scanner
participant I as IMAP server
S->>I: TCP connect :143
I-->>S: * OK IMAP4rev1 ready
S->>I: a001 STARTTLS
I-->>S: a001 OK Begin TLS now
S->>I: TLS handshake (AuthenticateAsClient)
How to test
Files to review first
Audit Details...Context
Scope
Strengths
Issues and risks
Testing
Security
Performance
Operations
Documentation
Diff overview
|
Implements WI-1. Closes #8.
What
Fix the IMAP STARTTLS branch in
Tool/Common/Test_SSL_Support.csso SSL scans on port 143 actually work. The branch was a verbatim copy of the POP3 branch above it: it expected a POP3+OKgreeting and sent the POP3STLScommand. Per RFC 3501, IMAP servers greet with* OK; per RFC 2595, STARTTLS is a tagged IMAP command (<tag> STARTTLS). Every IMAP STARTTLS scan therefore threwInvalidOperationException("IMAP Server did not respond to connection request")unconditionally.Why
The README advertises IMAP STARTTLS support but the feature has been broken since it was copy-pasted from the POP3 branch. Without this fix, anyone scanning an IMAP server on port 143 sees a meaningless error and concludes the tool is broken.
Score
Impact 4 × Confidence 5 ÷ Effort 1 = 20 (highest-Score row in the registry — broken advertised feature, ~10 line fix).
Changes
Tool/Common/Test_SSL_Support.cs(port == 143block):+OK→* OK(RFC 3501 untagged OK).STLS→a001 STARTTLS(RFC 2595 tagged).IndexOf(" OK", OrdinalIgnoreCase)soa001 OK Begin TLSis accepted.STARTTLSinstead ofSTLS.Tool/JocysCom.SslScanner.Tool.csproj:<Version>1.1.6</Version>→<Version>1.1.7</Version>.Tool/Documents/ChangeLog.txt: prepend dated v1.1.7 entry..ai/work-item-improvement.md: flip WI-1[Working]→[Done].Verification
.ai/repository-analysis.instructions.md); manual verification against a live IMAP server (e.g.imap.gmail.com:143) is the only available path — reviewer should runTool/Common/Test_SSL_Support.bator the GUI scan against a real STARTTLS-on-143 server and confirm the certificate fields populate.Symbiosis
Parent of any future IMAP-related improvements (none filed). No other open rows depend on this fix.
🤖 Generated with Claude Code