Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 17ab0e4

Browse files
committed
Allow absolute paths.
1 parent 3febfed commit 17ab0e4

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/oidcrp/util.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import io
33
import json
44
import logging
5+
import os
56
import ssl
67
import sys
78
from http.cookiejar import Cookie
@@ -341,12 +342,19 @@ def set_param(instance, config, param, **kwargs):
341342
def create_context(dir_path, config, **kwargs):
342343
_fname = lower_or_upper(config, "server_cert")
343344
if _fname:
344-
_cert_file = "{}/{}".format(dir_path, _fname)
345+
if _fname.startswith("/"):
346+
_cert_file = _fname
347+
else:
348+
_cert_file = os.path.join(dir_path, _fname)
345349
else:
346350
return None
351+
347352
_fname = lower_or_upper(config, "server_key")
348353
if _fname:
349-
_key_file = "{}/{}".format(dir_path, _fname)
354+
if _fname.startswith("/"):
355+
_key_file = _fname
356+
else:
357+
_key_file = os.path.join(dir_path, _fname)
350358
else:
351359
return None
352360

0 commit comments

Comments
 (0)