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

Don't require ssl module #3211

Closed
davidism opened this issue May 22, 2019 · 3 comments

Comments

@davidism
Copy link
Member

commented May 22, 2019

Python can be compiled without certain modules, including ssl. It's somewhat common for that to happen when users compile Python from source and don't have the libssl headers set up. flask.cli imports ssl unconditionally, but it's only for optional SSL cert support in the dev server, so this can be guarded with except ImportErrror. Werkzeug already has such a workaround, although it's a little more complicated than what needs to be done in Flask.

If no ssl module is imported, using the cert-related options in the CLI should raise a usage error.

@davidism davidism added this to the 1.1.0 milestone May 22, 2019

@t3ja

This comment was marked as outdated.

Copy link

commented May 23, 2019

Hey David,

I'm trying to make this my first contrib to flask.

From what I understand:

  • import ssl needs to be removed from flask/cli.py
  • CertParamType.convert method and _validate_key function should try to import ssl module and raise a usage error in case of an ImportError

Is there anything else I'm missing?

@davidism

This comment was marked as outdated.

Copy link
Member Author

commented May 23, 2019

Hi, while I appreciate that you'd like to start contributing, this task is tagged for an upcoming sprint.

As to the questions, I'd expect to use the same except guard that's used for other optional imports, and check whether its none when validating.

@t3ja

This comment was marked as outdated.

Copy link

commented May 24, 2019

Hi, while I appreciate that you'd like to start contributing, this task is tagged for an upcoming sprint.

So, Can I still make the changes and create a PR against the current 1.0.x branch?
Or should I just ignore this issue and move on for now?
(maybe until there's a 1.1.0 branch setup for the milestone)

@davidism davidism removed this from the 1.1.0 milestone May 30, 2019

cslecrone added a commit to cslecrone/flask that referenced this issue May 31, 2019

davidism added a commit that referenced this issue Jun 1, 2019

@davidism davidism closed this Jun 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.