Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssl.CERT_REQUIRED_NO_VERIFY as possible value for ssl.SSLContext.verify_mode #90935

Open
freundTech mannequin opened this issue Feb 17, 2022 · 1 comment
Open

Add ssl.CERT_REQUIRED_NO_VERIFY as possible value for ssl.SSLContext.verify_mode #90935

freundTech mannequin opened this issue Feb 17, 2022 · 1 comment
Assignees
Labels
3.11 only security fixes topic-SSL type-feature A feature request or enhancement

Comments

@freundTech
Copy link
Mannequin

freundTech mannequin commented Feb 17, 2022

BPO 46779
Nosy @tiran, @freundTech

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tiran'
closed_at = None
created_at = <Date 2022-02-17.16:53:40.117>
labels = ['expert-SSL', 'type-feature', '3.11']
title = 'Add ssl.CERT_REQUIRED_NO_VERIFY as possible value for ssl.SSLContext.verify_mode'
updated_at = <Date 2022-02-17.16:53:40.117>
user = 'https://github.com/freundTech'

bugs.python.org fields:

activity = <Date 2022-02-17.16:53:40.117>
actor = 'freundTech'
assignee = 'christian.heimes'
closed = False
closed_date = None
closer = None
components = ['SSL']
creation = <Date 2022-02-17.16:53:40.117>
creator = 'freundTech'
dependencies = []
files = []
hgrepos = []
issue_num = 46779
keywords = []
message_count = 1.0
messages = ['413416']
nosy_count = 2.0
nosy_names = ['christian.heimes', 'freundTech']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue46779'
versions = ['Python 3.11']

@freundTech
Copy link
Mannequin Author

freundTech mannequin commented Feb 17, 2022

Some networked applications might require connecting to client with invalid certificates but still requiring the client to send a certificate.

ssl.SSLContext.verify_mode currently supports the following options:
ssl.CERT_NONE: Don't require the client to send a certificate and don't validate it if they send one anyways.
ssl.CERT_OPTIONAL: Don't require the client to send a certificate but validate it if they send one.
ssl.CERT_REQUIRED: Require the client to send a certificate and validate it.

There is currently no option for servers that want to require the client to send a certificate but don't validate it.

This would for example be needed it a server should accept clients with self-signed certificates and then store their certificates to recognize them again later.

A concrete example is the KDEConnect protocol.

An alternative solution would be bpo-31242. That would also solve this problem is a more general, but also more complicated way.

I think that the solution proposed here this issue is better for it's simplicity and also solves most usecases for bpo-31242.

Note that a ssl.CERT_REQUIRED_NO_VERIFY was already proposed in bpo-18293, but that issue was closed because it was specifically in relation to a deprecated api. The mentioned values are however also used in modern asyncio apis.

@freundTech freundTech mannequin added the 3.11 only security fixes label Feb 17, 2022
@freundTech freundTech mannequin assigned tiran Feb 17, 2022
@freundTech freundTech mannequin added topic-SSL type-feature A feature request or enhancement 3.11 only security fixes labels Feb 17, 2022
@freundTech freundTech mannequin assigned tiran Feb 17, 2022
@freundTech freundTech mannequin added topic-SSL type-feature A feature request or enhancement labels Feb 17, 2022
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes topic-SSL type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant