Skip to content

Commit 33d2ba6

Browse files
valentin-pinkauvalentin-pinkau
andauthored
set cafile when rebuilding the ssl context (#1223)
* set cafile when rebuilding the ssl context * add changelog --------- Co-authored-by: valentin-pinkau <[email protected]>
1 parent 4882724 commit 33d2ba6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section
1919
### Changed
2020

2121
### Fixed
22+
- Fixed unpickling of the SSL_Context to allow for a second or third pickling. [#1223](https://github.com/scalableminds/webknossos-libs/pull/1223)
2223

2324

2425
## [0.16.0](https://github.com/scalableminds/webknossos-libs/releases/tag/v0.16.0) - 2024-11-27

webknossos/webknossos/dataset/defaults.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _create_sslcontext() -> ssl.SSLContext:
1919
def _save_sslcontext(
2020
obj: ssl.SSLContext,
2121
) -> tuple[Callable[[Any, Any], ssl.SSLContext], tuple[ssl._SSLMethod, Optional[str]]]:
22-
cafile = getattr(obj, "cafile")
22+
cafile = getattr(obj, "cafile", None)
2323
return _rebuild_sslcontext, (obj.protocol, cafile)
2424

2525

@@ -29,6 +29,7 @@ def _rebuild_sslcontext(
2929
ssl_context = ssl.SSLContext(protocol)
3030
if cafile is not None:
3131
ssl_context.load_verify_locations(cafile=cafile)
32+
ssl_context.cafile = cafile # type: ignore
3233
return ssl_context
3334

3435

0 commit comments

Comments
 (0)