mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-12 16:26:12 +01:00
8 lines
418 B
Python
Executable File
8 lines
418 B
Python
Executable File
import OpenSSL
|
|
from datetime import datetime
|
|
filePath = '/etc/letsencrypt/live/%s/fullchain.pem' % ('hello.com')
|
|
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
|
|
open(filePath, 'r').read())
|
|
expireData = x509.get_notAfter().decode('ascii')
|
|
finalDate = datetime.strptime(expireData, '%Y%m%d%H%M%SZ')
|
|
print x509.get_issuer().get_components()[1][1] |