Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SiCKRAGE
sickrage
Commits
d062f15c
Commit
d062f15c
authored
Jan 23, 2022
by
echel0n
Browse files
Fixed issue with custom HTTPS certificates and incorrectly identifying renewal status
parent
5a414b61
Changes
1
Hide whitespace changes
Inline
Side-by-side
sickrage/core/webserver/helpers.py
View file @
d062f15c
...
...
@@ -100,7 +100,8 @@ def certificate_needs_renewal(cert_file):
with
open
(
cert_file
,
'rb'
)
as
f
:
cert_pem
=
f
.
read
()
cert
=
x509
.
load_pem_x509_certificate
(
cert_pem
,
default_backend
())
not_valid_after
=
cert
.
not_valid_after
cert_info
=
x509
.
load_pem_x509_certificate
(
cert_pem
,
default_backend
())
expiry_date
=
cert_info
.
not_valid_after
time_left
=
expiry_date
.
date
()
-
datetime
.
date
.
today
()
return
not_valid_after
-
datetime
.
datetime
.
utcnow
()
<
(
cert
.
not_valid_after
-
cert
.
not_valid_before
)
/
2
\ No newline at end of file
return
time_left
.
days
<
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment