-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QUIC code should process verify correctly when given a directory (#1179)
path. [#1174]
- Loading branch information
Showing
3 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license | ||
|
||
import os | ||
from typing import Optional, Tuple, Union | ||
|
||
|
||
def convert_verify_to_cafile_and_capath( | ||
verify: Union[bool, str], | ||
) -> Tuple[Optional[str], Optional[str]]: | ||
cafile: Optional[str] = None | ||
capath: Optional[str] = None | ||
if isinstance(verify, str): | ||
if os.path.isfile(verify): | ||
cafile = verify | ||
elif os.path.isdir(verify): | ||
capath = verify | ||
else: | ||
raise ValueError("invalid verify string") | ||
return cafile, capath |
This file contains 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
This file contains 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