aboutsummaryrefslogtreecommitdiffstats
path: root/ydb/public/sdk/python3/ydb/auth_helpers.py
blob: 6399c3cfdf0d6c2407b0296efe8a529cd26a9a11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# -*- coding: utf-8 -*-
import os


def read_bytes(f):
    with open(f, "rb") as fr:
        return fr.read()


def load_ydb_root_certificate():
    path = os.getenv("YDB_SSL_ROOT_CERTIFICATES_FILE", None)
    if path is not None and os.path.exists(path):
        return read_bytes(path)
    return None