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

Commit 039b2a6

Browse files
committed
Allow for absolute file name specifications.
1 parent 907c446 commit 039b2a6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/oidcop/utils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import json
3+
import os
34
import ssl
45
import sys
56

@@ -37,12 +38,18 @@ def lower_or_upper(config, param, default=None):
3738
def create_context(dir_path, config, **kwargs):
3839
_fname = lower_or_upper(config, "server_cert")
3940
if _fname:
40-
_cert_file = "{}/{}".format(dir_path, _fname)
41+
if _fname.startswith("/"):
42+
_cert_file = _fname
43+
else:
44+
_cert_file = os.path.join(dir_path, _fname)
4145
else:
4246
return None
4347
_fname = lower_or_upper(config, "server_key")
4448
if _fname:
45-
_key_file = "{}/{}".format(dir_path, _fname)
49+
if _fname.startswith("/"):
50+
_key_file = _fname
51+
else:
52+
_key_file = os.path.join(dir_path, _fname)
4653
else:
4754
return None
4855

0 commit comments

Comments
 (0)