File: util.py

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (16 lines) | stat: -rw-r--r-- 460 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os
from pathlib import Path


def _find_certificate():
    devcert_path = Path(os.getenv('SDK_REPO') + '/eng/common/testproxy/dotnet-devcert.crt')
    with open(devcert_path, 'r') as fr:
        return fr.read()


def add_certificate():
    certification = _find_certificate()
    cacert_path = Path('../venv-sdk/lib/python3.8/site-packages/certifi/cacert.pem')
    with open(cacert_path, 'a+') as f:
        f.seek(0, 0)
        f.write(certification)