Skip to content

Add test to https server - #57

Merged
lovelydinosaur merged 1 commit into
encode:masterfrom
yeraydiazdiaz:test-https
May 14, 2019
Merged

lovelydinosaur merged 1 commit into
encode:masterfrom
yeraydiazdiaz:test-https

Conversation

@yeraydiazdiaz

@yeraydiazdiaz yeraydiazdiaz commented May 13, 2019 •

Copy link
Copy Markdown
Contributor

Add https_server test fixture.

The self-signed certificate was created using these steps.

@yeraydiazdiaz

Copy link
Copy Markdown
Contributor Author

In terms of test coverage, there are paths which are only hit with an appropriately signed certificate, not sure how we'd like to address that to achieve 100%.

@lovelydinosaur

Copy link
Copy Markdown
Member

How long is the cert signed for here?

@pquentin

Copy link
Copy Markdown
Contributor

For signed certificates, I would suggest using https://github.com/python-trio/trustme. We use this in urllib3 and it works well. For bonus points, generate new certs/keys dynamically in the tests, which is possible since trustme is written in Python. It avoids storing blobs in the test suite.

@lovelydinosaur

Copy link
Copy Markdown
Member

Oh nice! Great tip!

Add `https_server` test fixture
@yeraydiazdiaz

yeraydiazdiaz commented May 13, 2019 •

Copy link
Copy Markdown
Contributor Author

Updated with trustme, much cleaner, thanks @pquentin!

@lovelydinosaur
lovelydinosaur merged commit c27c635 into encode:master May 14, 2019
@lovelydinosaur

Copy link
Copy Markdown
Member

Great stuff. 馃槑

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants