Skip to content

Commit

Permalink
slight cleanup in trusted value
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Jan 24, 2024
1 parent 4de8374 commit 142fd43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion checks/tasks/tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import eventlet
import requests
from OpenSSL.SSL import X509VerificationCodes
from celery import shared_task
from celery.exceptions import SoftTimeLimitExceeded
from cryptography.hazmat.backends.openssl import rsa
Expand Down Expand Up @@ -1138,7 +1139,9 @@ def cert_checks(hostname, mode, task, af_ip_pair=None, dane_cb_data=None, *args,
tls_cert=True,
chain=chain_str,
# The trusted value is originally an errno from the validation call
trusted=0 if trusted_score == scoring.MAIL_TLS_TRUSTED_GOOD else 1,
trusted=0
if trusted_score == scoring.MAIL_TLS_TRUSTED_GOOD
else X509VerificationCodes.ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY,
trusted_score=trusted_score,
pubkey_bad=pubkey_bad,
pubkey_phase_out=pubkey_phase_out,
Expand Down

0 comments on commit 142fd43

Please sign in to comment.