File size: 572 Bytes
d93884d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests
import os
from dotenv import load_dotenv

def gen_zero_ssl_eab():
    load_dotenv()    
    apikey = os.getenv("ZEROSSLAPI")
    url = "https://api.zerossl.com/acme/eab-credentials"
    headers = {'Content-Type': 'application/json'}
    resp = requests.post(url, params={'access_key': apikey}, headers=headers)
    if resp.json()['success'] == False:
        print("Error: ", resp.json()['error'])
        return "Error", "Error"
    else:
        kid = resp.json()['eab_kid']
        hmac = resp.json()['eab_hmac_key']
    return kid, hmac