Format uptime in human readable format
(seconds)
| 16707 | try: san.append(x509.DNSName(h)) |
| 16708 | except Exception: pass |
| 16709 | for ip in ips: |
| 16710 | try: san.append(x509.IPAddress(ipaddress.ip_address(ip))) |
| 16711 | except Exception: pass |
| 16712 | cert = (x509.CertificateBuilder() |
| 16713 | .subject_name(subject).issuer_name(issuer) |
| 16714 | .public_key(key.public_key()) |
| 16715 | .serial_number(x509.random_serial_number()) |
| 16716 | .not_valid_before(_dt.datetime.utcnow() - _dt.timedelta(minutes=5)) |
| 16717 | .not_valid_after(_dt.datetime.utcnow() + _dt.timedelta(days=365)) |
| 16718 | .add_extension(x509.SubjectAlternativeName(san), critical=False) |
| 16719 | .sign(key, hashes.SHA256(), default_backend())) |
| 16720 | with open(key_path, 'wb') as f: |
| 16721 | f.write(key.private_bytes( |
| 16722 | encoding=serialization.Encoding.PEM, |
| 16723 | format=serialization.PrivateFormat.TraditionalOpenSSL, |
no outgoing calls
no test coverage detected