Skip to content

Commit

Permalink
Fix bizarre SSL recursion errors by moving truststore init earlier (#796
Browse files Browse the repository at this point in the history
)

Fixes #735.

Modifies previous #726.
  • Loading branch information
dbarnett authored Oct 2, 2024
1 parent 40090b9 commit 16909a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
v4.5.1
* Fix bizarre SSL recursion errors by moving truststore init earlier
* Adjust "when" value parsing to handle YYYY-MM-DD consistently

v4.5.0
Expand Down
19 changes: 12 additions & 7 deletions gcalcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,38 @@
# Everything you need to know (Google API Calendar v3): http://goo.gl/HfTGQ #
# #
# ######################################################################### #
from argparse import ArgumentTypeError


# Import trusted certificate store to enable SSL, e.g., behind firewalls.
# Must be called as early as possible to avoid bugs.
# fmt: off
import truststore; truststore.inject_into_ssl() # noqa: I001,E702
# fmt: on
# ruff: noqa: E402


import json
import os
import pathlib
import re
import signal
import sys
from argparse import ArgumentTypeError
from collections import namedtuple

import truststore

from . import config, env, utils
from .argparsers import get_argument_parser, handle_unparsed
from .exceptions import GcalcliError
from .gcal import GoogleCalendarInterface
from .printer import Printer, valid_color_name
from .validators import (
get_input,
DATE_INPUT_DESCRIPTION,
PARSABLE_DATE,
PARSABLE_DURATION,
REMINDER,
STR_ALLOW_EMPTY,
STR_NOT_EMPTY,
get_input,
)

CalName = namedtuple('CalName', ['name', 'color'])
Expand Down Expand Up @@ -145,9 +153,6 @@ def run_add_prompt(parsed_args, printer):


def main():
# import trusted certificate store to enable SSL, e.g., behind firewalls
truststore.inject_into_ssl()

parser = get_argument_parser()
argv = sys.argv[1:]

Expand Down

0 comments on commit 16909a9

Please sign in to comment.