add AYON_CERT_FILE to try server request#248
Closed
jm22dogs wants to merge 2 commits intoynput:developfrom
Closed
Conversation
iLLiCiTiT
reviewed
Apr 29, 2025
ayon_api/utils.py
Outdated
| # TODO add validation if the url lead to AYON server | ||
| # - this won't validate if the url lead to 'google.com' | ||
| requests.get(url, timeout=timeout) | ||
| requests.get(url, timeout=timeout, verify=os.getenv("AYON_CERT_FILE")) |
Member
There was a problem hiding this comment.
Suggested change
| requests.get(url, timeout=timeout, verify=os.getenv("AYON_CERT_FILE")) | |
| requests.get( | |
| url, timeout=timeout, verify=os.getenv("AYON_CERT_FILE") | |
| ) |
Member
There was a problem hiding this comment.
Looking at ServerAPI which does something like this:
ssl_verify = os.environ.get("AYON_CA_FILE") or True
cert = os.environ.get("AYON_CERT_FILE")
requests.get(
url, timeout=timeout, verify=ssl_verify, cert=cert
)Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
iLLiCiTiT
reviewed
May 2, 2025
Comment on lines
+332
to
+334
| requests.get( | ||
| url, timeout=timeout, verify=os.getenv("AYON_CERT_FILE") | ||
| ) |
Member
There was a problem hiding this comment.
The verify argument is used to "check for ssl certificates" (and you can specify file with custom CA authority), using "standard CA authorities" when set to True, and cert is used to define custom path validated against CA authority.
Suggested change
| requests.get( | |
| url, timeout=timeout, verify=os.getenv("AYON_CERT_FILE") | |
| ) | |
| ssl_verify = os.environ.get("AYON_CA_FILE") or True | |
| cert = os.environ.get("AYON_CERT_FILE") or None | |
| requests.get( | |
| url, timeout=timeout, verify=ssl_verify, cert=cert | |
| ) |
Member
|
Closing in favor of #249 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Description
When the Ayon Launcher tests the server url before login, the
AYON_CERT_FILEenv var is not passed to the get requests that pings the server, and fails even if there is a custom self signed cert pointed in that varAYON_CERT_FILE.This PR simply adds that env var to the verify kwarg in the requests.get method.