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

allow me to set basicConstraints so I can set certificate chains #85

Closed
glyph opened this issue Mar 31, 2014 · 4 comments
Closed

allow me to set basicConstraints so I can set certificate chains #85

glyph opened this issue Mar 31, 2014 · 4 comments

Comments

@glyph
Copy link
Contributor

glyph commented Mar 31, 2014

https://www.openssl.org/docs/apps/x509v3_config.html#Basic_Constraints_

I was trying to write a test case that verified a certificate chain "for real" and I noticed that there doesn't seem to be a way to set basicConstraints so that OpenSSL thinks an intermediate certificate is a valid CA.

@exarkun
Copy link
Member

exarkun commented Mar 31, 2014

You can do this with X509.add_extensions.

@exarkun exarkun closed this as completed Mar 31, 2014
@glyph
Copy link
Contributor Author

glyph commented Mar 31, 2014

Do I have to synthesize my own ASN.1 string? I kinda want to use the "nice" way that OpenSSL lets you say, for example, "CA:true".

@exarkun
Copy link
Member

exarkun commented Mar 31, 2014

X509Extension("basicConstraints", True, "CA:true")

@glyph
Copy link
Contributor Author

glyph commented Mar 31, 2014

Aha, I had found https://pythonhosted.org/pyOpenSSL/api/crypto.html#x509extension-objects but glossed over https://pythonhosted.org/pyOpenSSL/api/crypto.html#OpenSSL.crypto.X509Extension which is where the crucial "typename" string is documented. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants