Skip to content

fix: avoid using startswith for SSL configuration#1097

Merged
nijel merged 1 commit into
mainfrom
ssl
Jan 7, 2026
Merged

fix: avoid using startswith for SSL configuration#1097
nijel merged 1 commit into
mainfrom
ssl

Conversation

@nijel

@nijel nijel commented Jan 7, 2026

Copy link
Copy Markdown
Member

It would wrongly match hosts whose domain name starts with 127.0.0.1.

@nijel nijel requested a review from Copilot January 7, 2026 15:27
@nijel nijel self-assigned this Jan 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in SSL certificate verification logic where hostnames starting with "127.0.0.1" (like "127.0.0.1.example.com") would incorrectly be treated as localhost and skip SSL verification.

Key Changes:

  • Replaced string prefix matching (startswith) with exact hostname matching using a set lookup
  • Expanded localhost detection to include multiple localhost representations: "127.0.0.1", "localhost", "::1", and "[::1]"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wlc/__init__.py Outdated
Comment thread wlc/__init__.py Outdated
It would wrongly match hosts whose domain name starts with 127.0.0.1.
@nijel nijel merged commit a513864 into main Jan 7, 2026
51 checks passed
@nijel nijel deleted the ssl branch January 7, 2026 16:17
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