-
Notifications
You must be signed in to change notification settings - Fork 162
Improvements to letsencrypt_mgmt_profile.py #237
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
Conversation
Using tenant with "*" breaks the script as it searches for the tenant, but doesn't find it. As per AVI Python SDK when no value is specified (so using None), it will fallback to the default tenant for the specified user.
Certificate is being checked by default.
As its ensured that the VS is listening on port 80 anyway, we don't need to only apply the rule to port 80. The advantage is following: When HTTP-to-HTTPS redirect is enabled in the ApplicationProfile/parent VirtualHosting, the rule for port 80 won't apply and token validation fails. Without this, it also works on HTTPS (443) and token verification succeeds (LetsEncrypt follows redirect from :80 to :443 for token validation)
This was quite tricky, as child-VH VSs use vh_domain_name and cannot be identified via fqdn and don't have services object in the result. Therefore, when child VS detected, we do a slightly different search for VSs and set the services object from the parent VS. This way the later logic is mainly untouched.
nikhilky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these enhancements. I had few comments
chitr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets log the Exceptions
| keyauthorization = "{0}.{1}".format(token, thumbprint) | ||
|
|
||
| # Update vs | ||
| # Get VSVIPs/VSs, based on FQDN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break this flow to smaller functions based on related functionality.
| print ("Found vs {} with fqdn {}".format(vs_uuid, domain)) | ||
| # Check if the vs is servering on port 80 | ||
|
|
||
| # Let's check if VS is enabled, otherwise challenge can never successfully complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets move avi specific flow to separate function.(for next iteration )
|
I have had a chat with @nikhilky on this one. Main points:
I have tested the current version, the last commit, working well on the latest 21.1. There seems to be some issue when using multiple domains on one VS (basically using SANs) because of some restrictions of the |
nikhilky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this PR with @chitr. The remaining items will be taken up in the next iteration.
Notable changes:
Virtual Hostingscenarios (SNI)Tested it with VH setup with SNI, RSA and ECDSA with a public-reachable test domain.