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

Add tests for Ingress TLS termination #1525

Merged
merged 2 commits into from Apr 13, 2021
Merged

Add tests for Ingress TLS termination #1525

merged 2 commits into from Apr 13, 2021

Conversation

pleshakov
Copy link
Contributor

Proposed changes

Add tests for Ingress TLS termination
The new tests follow https://github.com/nginxinc/kubernetes-ingress/blob/master/tests/suite/test_virtual_server_tls.py
Happy to hear thoughts about combining both Ingress and TLS into one.

try:
get_server_certificate_subject(endpoint.public_ip, host, endpoint.port_ssl)
pytest.fail("We expected an SSLError here, but didn't get it or got another error. Exiting...")
except SSLError:
Copy link
Contributor

@vepatel vepatel Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pleshakov can we assert something negative rather than failing the test?

When NGINX terminates a TLS connection for a server
with a missing/invalid TLS secret, we expect NGINX
to reject the connection with the error
TLSV1_UNRECOGNIZED_NAME

In this commit we:
* ensure the specific error
* rename the assertion function to be more specific
@pleshakov pleshakov requested a review from vepatel April 12, 2021 18:49
@pleshakov pleshakov merged commit 0c2e0b9 into master Apr 13, 2021
@pleshakov pleshakov deleted the add-ing-tls-tests branch April 13, 2021 16:04
@lucacome lucacome added the chore Pull requests for routine tasks label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants