pyca / pyca/pyopenssl

Missing export of `OpenSSL.SSL.FILETYPE_ASN1`

Open
#1,217 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
944
Forks
440
Avg merge
1d 6h
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the documented OpenSSL.SSL.FILETYPE_ASN1 entry with the imports in src/OpenSSL/SSL.py. Reproduce the issue in a Python shell and check the existing OpenSSL.crypto.FILETYPE_ASN1 workaround. Done means the documented SSL attribute is available without an AttributeError and the documentation matches the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.