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

Missing export of OpenSSL.SSL.FILETYPE_ASN1 #1217

Open
ChristianStadelmann opened this issue May 25, 2023 · 1 comment
Open

Missing export of OpenSSL.SSL.FILETYPE_ASN1 #1217

ChristianStadelmann opened this issue May 25, 2023 · 1 comment

Comments

@ChristianStadelmann
Copy link

There is a mismatch between documentation of OpenSSL.SSL and the real behavior.

Steps to reproduce:

  1. install pyopenssl
  2. open a python shell
  3. In the shell, execute: import OpenSSL
  4. In the shell, execute: print(OpenSSL.SSL.FILETYPE_PEM)
  5. In the shell, execute: print(OpenSSL.SSL.FILETYPE_ASN1)

What happens:

import OpenSSL
>>> print(OpenSSL.SSL.FILETYPE_PEM)
1
>>> print(OpenSSL.SSL.FILETYPE_ASN1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'OpenSSL.SSL' has no attribute 'FILETYPE_ASN1'

What should happen:

no error. The documentation claims that FILETYPE_ASN1 should be available, so it should work.

Additional info:

The code behavior is expected, see the imports of SSL.py from OpenSSL.crypto, this looks like a mismatch between documentation and code to me. Reading the value from OpenSSL.crypto.FILETYPE_ASN1 works fine (workaround).

Installed version: pyopenssl-23.1.1

@reaperhulk
Copy link
Member

We'd be happy to take a PR to fix this (Either the documentation or adding the export from crypto to SSL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants