-
Notifications
You must be signed in to change notification settings - Fork 23
Add skip verify cli flag #55
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Lukas Bachschwell <[email protected]>
Signed-off-by: Lukas Bachschwell <[email protected]>
Signed-off-by: Lukas Bachschwell <[email protected]>
Signed-off-by: Lukas Bachschwell <[email protected]>
homeassistant_satellite/__main__.py
Outdated
@@ -69,6 +69,7 @@ async def main() -> None: | |||
choices=("http", "https"), | |||
help="Home Assistant protocol", | |||
) | |||
parser.add_argument("--skipVerify", action="store_true", help="Skip verification of the SSL certificate") |
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.
parser.add_argument("--skipVerify", action="store_true", help="Skip verification of the SSL certificate") | |
parser.add_argument("--skip-certificate-verification", action="store_true", help="Skip verification of the SSL certificate") |
Existing arguments use lowercase and dashes in between words, so you should follow that. Even then skip-verify
would be too generic IMO.
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.
made it --skip-verify. you you really want it to extend ? There is not really another thing to confuse it with, apart from that it has a help text
homeassistant_satellite/__main__.py
Outdated
@@ -235,6 +236,7 @@ async def main() -> None: | |||
host=args.host, | |||
protocol=args.protocol, | |||
port=args.port, | |||
skipVerify=args.skipVerify, |
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.
skipVerify=args.skipVerify, | |
skipVerify=args.skipVerify, |
Python generally uses snake case, not camel case.
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.
done
if skipVerify: | ||
self._session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) | ||
else: | ||
self._session = aiohttp.ClientSession() | ||
|
||
self._session = aiohttp.ClientSession() |
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.
Why don't you always pass the negated value to the TCPConnector
here?
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.
done
- snake case - inversion for passing arg to clientconnection Signed-off-by: Lukas Bachschwell <[email protected]>
Anything else needed here ? |
Adds --skipVerify CLI flag to work with self signed SSL certificates. Fixes #18