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

Have tests generate a certificate on-the-fly #4651

Closed
Gallaecio opened this issue Jun 29, 2020 · 5 comments · Fixed by #4761
Closed

Have tests generate a certificate on-the-fly #4651

Gallaecio opened this issue Jun 29, 2020 · 5 comments · Fixed by #4761

Comments

@Gallaecio
Copy link
Member

Unless we want to be doing #4650 every year, we should look into making tests generate a fresh certificate at run time.

@Urahara
Copy link

Urahara commented Jun 30, 2020

We could use this so we can generate without any prompt, where do you think we could put this? I would like to add this functionality.

@Gallaecio
Copy link
Member Author

I wonder if we could implement it as a pytest fixture. Otherwise, having pytest create the file (overwriting) at the beginning of a test session should do the job; it may be even better, as it’s probably much simpler.

@wRAR
Copy link
Member

wRAR commented Jul 1, 2020

I have a small concern that in some environments there will be not enough entropy for doing this quickly, but we'll need to actually check this.

@Urahara
Copy link

Urahara commented Jul 1, 2020

I have a small concern that in some environments there will be not enough entropy for doing this quickly, but we'll need to actually check this.

I think i know what you mean, doing a little more research i found this answer: https://stackoverflow.com/a/60804101/9291099, generating programmatically is more safe than using a command, right? Can you take a look @Gallaecio

@Gallaecio
Copy link
Member Author

I don’t think that kind of safety matters here, given the purpose of the certificate. I wouldn’t put too much effort in creating it using a Python library if it can be done easily with a command.

Mind, however, that the command would probably have to be executed from some Python code using POpen (I would check pytest documentation for possible places where to put such a call).

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

Successfully merging a pull request may close this issue.

3 participants