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

generate_adhoc_ssl_pair: make issuer match subject #1430

Merged
merged 1 commit into from Jan 12, 2019
Merged

generate_adhoc_ssl_pair: make issuer match subject #1430

merged 1 commit into from Jan 12, 2019

Conversation

@mephi42
Copy link
Contributor

@mephi42 mephi42 commented Jan 5, 2019

With this change, the generated certificate can be trusted,
and the following command starts working:

openssl s_client -showcerts -connect dev:443 -verifyCAfile dev.crt </dev/null
With this change, the generated certificate can be trusted,
and the following command starts working:

    openssl s_client -showcerts -connect dev:443 -verifyCAfile dev.crt </dev/null
@davidism
Copy link
Member

@davidism davidism commented Jan 5, 2019

Why does it need to be trusted? The command is not meant for making a good certificate, it's meant for quickly making a development one. Clearly marking it as such, as is done now, seems better.

@mephi42
Copy link
Contributor Author

@mephi42 mephi42 commented Jan 5, 2019

I found the ability to trust dev certificate useful for testing client's ability to work with custom CA bundles. In particular, when implementing requests-based clients, I need to make sure that I correctly pass the path to CA certificate as verify= argument to all relevant calls.

@davidism
Copy link
Member

@davidism davidism commented Jan 5, 2019

I'm not an expert on SSL. Why is the current version not trustable? What does the change do to make it so?

@mephi42
Copy link
Contributor Author

@mephi42 mephi42 commented Jan 5, 2019

The way I see it is that when a web server presents a certificate to a client, a client uses the issuer field to build the trust chain. Currently issuer points to the non-existent CN=Untrusted Authority,O=Self-Signed certificate, and so the verification immediately fails.

When I change the issuer field to point to the dev certificate itself, and trust the dev certificate using e.g. -verifyCAfile or verify=, then issuer begins to point to the trusted certificate, and so the verification succeeds.

@davidism davidism added this to the 0.15 milestone Jan 12, 2019
@davidism davidism merged commit 7ed607a into pallets:master Jan 12, 2019
1 check passed
davidism added a commit that referenced this issue Jan 12, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants