{% extends "logs/layout.html" %} {% block title %} {%- if ui_tls_failed %} {{ _("Invalid TLS Certificate")}} {%- else %} {{- _("Examine TLS certificates") }} {%- endif %} {% endblock %} {% block content %}
{%- if ui_tls_failed %}

{{ _("Invalid TLS Certificate")}}

{%- else %}

{::}

{%- endif %}
{{ csrf_field|safe }} {%- for host in state.query_args.host %} {%- if result and result != True and host in result %} {%- set r = result[host] %} {%- if r[0] %} {%- set cert_validated = r[2].cert_validated %} {%- set hostname_matches = r[2].hostname_matches %} {%- set tofu_invalid = r[2].tofu_invalid %} {%- set valid = cert_validated and hostname_matches and not tofu_invalid %} {%- if ui_tls_failed and not valid %}

{{ _("The identity of the remote server ({H}) could not be verified.").format(H=host)}}

{%- else %}

{{ host|replace(':443', '')|replace(':', ' : ')|truncate(25) }}


{%- endif %}

{% for grp in r[2].fingerprint %} {{ grp }} {% if not (loop.index % 4) %}
{% endif %} {% endfor %}

{{_("SHA-256 Fingerprint")}}

{{_("Certificate Vitals")}}:

{% set green = (valid or r[2].using_tofu) and 'color-08-green' or 'color-02-gray' %}
{% if ui_tls_failed and not valid %}

{{ _("If the certificate cannot be verified, then there is no guarantee you are communicating with the right server.") }} {{ _("Your account details or e-mail may be at risk if you proceed.") }}

{{ _("Some servers deliberately use certificates that cannot be verified; in such cases adding a security exception should be safe.") }} {{ _("Ask your e-mail server administrator to be sure.") }}

{% else %}
{% if not cert_validated %}

{{_("The information below could not be validated. It may be incorrect or forged.")}}

{% endif %}
{{_("Issued To")}}: {{ r[2].subject.commonName }}

{%- if r[2].subject.organizationalUnitName %}{{ r[2].subject.organizationalUnitName }}
{% endif %} {%- if r[2].subject.organizationName %}{{ r[2].subject.organizationName }}
{% endif %} {%- if r[2].subject.localityName %}{{ r[2].subject.localityName }}
{% endif %} {%- if r[2].subject.stateOrProvinceName %}{{ r[2].subject.stateOrProvinceName }}
{% endif %} {%- if r[2].subject.countryName %}{{ r[2].subject.countryName }}
{% endif %}

{% if cert_validated %}
{{_("Issued By")}}: {{ r[2].issuer.commonName or _("unknown") }}
{% else %}
{{_("Apparently Issued By")}}: {{ r[2].issuer.commonName or _("unknown") }}
{% endif %}

{%- if r[2].issuer.organizationalUnitName %}{{ r[2].issuer.organizationalUnitName }}
{% endif %} {%- if r[2].issuer.organizationName %}{{ r[2].issuer.organizationName }}
{% endif %} {%- if r[2].issuer.countryName %}{{ r[2].issuer.countryName }}
{% endif %}

{{_("Raw PEM Certificate")}}:

{{ r[2].pem }}
{% endif %} {% if not valid %} {% if not r[2].date_matches %}

{{_("Current date appears to be {D}. Is the system clock correct?") .format(D=r[2].current_time|friendly_datetime) }}

{% endif %}

{{_("If this certificate error is unsual, then adding a security exception is not recommended.")}}

{% endif %}

{%- if ui_tls_failed %} {%- if not valid %} {%- else %} {%- endif %} {%- else %}   {%- endif %} {%- if not ui_tls_failed %} {%- endif %} {%- if r[2].using_tofu %} {%- else %} {%- endif %}

{%- else %}

{{ host|replace(':443', '')|replace(':', ' : ') }}


{{ r[1] }}

{{ r[2] }}


{{_("Server")}}:

{%- endif %} {%- endif %} {%- endfor %} {%- if not state.query_args.host or result == True %}

{{_("TLS Certificates")}}


{{_("You can use this tool to examine the TLS certificates of remote servers.")}}

{{_("TLS certificates are a form of digital identification, used to ensure you are communicating with the intended server and not an imposter.")}}

{{_("If necessary, you can add security exceptions (TOFU: Trust on First Use) which will allow you to connect to a server even if it does not present a valid certificate.")}} {{_("When TOFU is in use, if the remote certificate ever changes the new one will be rejected until you add another exception.")}}

{{_("Server")}}:

{% if config.tls|length > 0 %}

{{_("Known Certificates")}}

{%- endif %} {%- endif %}
"result": {{ result|json }},
"state": {{ state|json }}
  
{% endblock %}