Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #279 from RedHatProductSecurity/add-verify-ssl
Browse files Browse the repository at this point in the history
added GRIFFON_VERIFY_SSL env var
  • Loading branch information
JimFuller-RedHat authored Jan 14, 2024
2 parents c66152f + 6064505 commit 6049de0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
* GRIFFON_VERIFY_SSL environment variable

## [0.4.1] - 2024-01-12
### Fixed
Expand Down
5 changes: 5 additions & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export OSIDB_USERNAME="<your username>"
export OSIDB_PASSWORD="<your password>"
```

To disable verifying ssl certificates:
```commandline
export GRIFFON_VERIFY_SSL="False"
```

### Enable autocompletion
Enable shell autocompletion by following these instructions for your specific shell.

Expand Down
9 changes: 8 additions & 1 deletion griffon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
GRIFFON_CONFIG_DIR = os.getenv("GRIFFON_API_URL", "~/.griffon")
GRIFFON_RC_FILE = "~/.griffonrc"
GRIFFON_DEFAULT_LOG_FILE = os.getenv("GRIFFON_DEFAULT_LOG_FILE", "~/.griffon/history.log")
GRIFFON_VERIFY_SSL = os.getenv("GRIFFON_VERIFY_SSL", "True").lower() in ("true", "1", "t")

logger = logging.getLogger("griffon")

Expand Down Expand Up @@ -138,6 +139,7 @@ def create_session():
try:
return component_registry_bindings.new_session(
component_registry_server_uri=CORGI_SERVER_URL,
verify_ssl=GRIFFON_VERIFY_SSL,
)
except: # noqa
console.log(f"{CORGI_SERVER_URL} is not accessible.")
Expand Down Expand Up @@ -204,7 +206,11 @@ def create_session():
if OSIDB_AUTH_METHOD == "credentials":
credentials["username"] = OSIDB_USERNAME
credentials["password"] = OSIDB_PASSWORD
return osidb_bindings.new_session(osidb_server_uri=OSIDB_SERVER_URL, **credentials)
return osidb_bindings.new_session(
osidb_server_uri=OSIDB_SERVER_URL,
verify_ssl=GRIFFON_VERIFY_SSL,
**credentials,
)
except: # noqa
console.log(f"{OSIDB_SERVER_URL} is not accessible (or krb ticket has expired).")
exit(1)
Expand Down Expand Up @@ -307,6 +313,7 @@ def create_session():
try:
return component_registry_bindings.new_session(
component_registry_server_uri=COMMUNITY_COMPONENTS_SERVER_URL,
verify_ssl=GRIFFON_VERIFY_SSL,
)
except: # noqa
console.log(f"{COMMUNITY_COMPONENTS_SERVER_URL } is not accessible.")
Expand Down

0 comments on commit 6049de0

Please sign in to comment.