senapati
Documentation index

SSL Info

Connects to a host's TLS port, reads the certificate it presents and reports what a browser would decide: is the chain trusted, does the name match, are the dates in range. The certificate is described in full even when it is expired or self-signed, so the report tells you why a site fails and not just that it does.

POST/api/ssl-infoCosts 1 creditAPI key

Inspect a host's TLS certificate and connection (1 credit)

What is checked

  • Trust. A verifying handshake against the system trust store. When it fails, a second handshake with verification off still fetches the certificate.
  • Name. The host is matched against the Subject Alternative Names the way RFC 6125 and browsers do: a wildcard covers one label (*.example.com matches www.example.com, not example.com). A certificate without SANs is flagged; browsers ignore the common name.
  • Dates. Expired, not yet valid, expiring within 14 days (warning) or 30 days (note), and a validity window over 398 days, which browsers refuse for publicly trusted certificates.
  • Key and signature. RSA or DSA under 2048 bits, EC under 256 bits, and SHA-1 or MD5 signatures are errors.
  • Connection. The TLS version and cipher suite the server negotiated with a modern client.

Connection status

connection_statusMeaning
okA handshake completed and a certificate was read
tls_errorThe port answered, but no TLS handshake completed (plain HTTP, old protocol, or no SNI match)
timeoutNo answer in time
unreachableThe connection was refused or failed
dns_errorThe host name did not resolve
blockedThe host resolves to a non-public address, which this service does not connect to

Issue codes

codetypeMeans
NO_CERTIFICATEerrorThe server presented no certificate
TLS_HANDSHAKE_FAILEDerrorThe port did not complete a TLS handshake
CONNECTION_FAILEDerrorThe host could not be reached
CERT_EXPIREDerrorThe validity period has ended
CERT_NOT_YET_VALIDerrorThe validity period has not started
CERT_EXPIRES_SOONwarning / infoFewer than 14 (warning) or 30 (info) days left
HOSTNAME_MISMATCHerrorNo name on the certificate covers the host
SELF_SIGNEDerrorIssuer and subject are the same; nobody trusts it by default
UNTRUSTED_ISSUERerrorThe chain does not lead to a trusted root (a private CA, a missing intermediate)
CHAIN_CERT_EXPIRED / CHAIN_CERT_NOT_YET_VALIDerrorAn intermediate in the chain is outside its validity period while the leaf is fine
CERT_UNPARSEABLEerrorThe certificate uses an algorithm or encoding the parser does not understand
WEAK_KEYerrorRSA/DSA under 2048 bits or EC under 256 bits
WEAK_SIGNATUREerrorSigned with SHA-1 or MD5
LONG_VALIDITYwarningValid for more than 398 days
NO_SUBJECT_ALT_NAMESwarningNo SAN extension; browsers ignore the common name
WILDCARD_CERTIFICATEinfoAt least one name is a wildcard

Request

JSON body
FieldTypeDescription
host*stringHost name or public IP address to connect to, e.g. example.com
portintegerTLS port; 443 unless the service uses anotherdefault 443

Authenticate with API key. Send it as the X-API-Key header.

curl -X POST "https://api.senapati.io/api/ssl-info" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"host":"github.com","port":443}'

Response

Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.

response: 200 OKSSLInfoData
{
"request_id": "req_b510d674",
"timestamp": "2026-10-28T07:37:47.495064+00:00",
"data": {
"host": "github.com",
"port": 443,
"connection_status": "ok",
"error": null,
"valid": true,
"has_certificate": true,
"chain_trusted": true,
"hostname_matches": true,
"certificate": {
"subject_common_name": "github.com",
"subject_organization": null,
"issuer_common_name": "Sectigo Public Server Authentication CA DV E36",
"issuer_organization": "Sectigo Limited",
"serial_number": "a59ebdb596751db7f5c095079613953c",
"not_before": "2026-09-01T00:00:00+00:00",
"not_after": "2026-11-29T23:59:59+00:00",
"days_until_expiry": 32,
"validity_days": 89,
"expired": false,
"not_yet_valid": false,
"subject_alt_names": [
"github.com",
"www.github.com"
],
"key_type": "ec",
"key_bits": 256,
"curve": "secp256r1",
"signature_algorithm": "ecdsa-with-SHA256",
"signature_hash": "sha256",
"fingerprint_sha256": "46b601ee08b418cf8a3a1ebfe670ba5ce43bb05a917fa8b2dd087a30471cfc63",
"fingerprint_sha1": "d3b63e61c64fd29ba9b8729628f8697f556a341f",
"self_signed": false,
"wildcard": false
},
"connection": {
"tls_version": "TLSv1.3",
"cipher": "TLS_AES_128_GCM_SHA256",
"cipher_bits": 128
},
"lookup_failed": false,
"issues_found": [],
"elapsed_ms": 562
}
}

valid is the browser's verdict; chain_trusted and hostname_matches say which part failed when it is false. certificate and connection are null when no handshake completed.

data · SSLInfoData
FieldTypeDescription
host*string
port*integer
connection_status*"ok" | "tls_error" | "timeout" | "unreachable" | "dns_error" | "blocked"ok: a handshake completed; tls_error: the port answered but no TLS handshake completed; timeout / unreachable / dns_error: the host could not be reached; blocked: the host resolves to a non-public address
error*string | nullWhy the connection failed, when it did
valid*booleanTrue when the chain is trusted, the name matches and the dates hold, as a browser would judge it
has_certificate*boolean
chain_trusted*boolean | nullThe chain leads to a root in the system trust store (dates and name aside); null when no certificate was read
hostname_matches*boolean | nullThe certificate covers the host that was asked for
certificate*CertificateInfo | null
↳ subject_common_name*string | null
↳ subject_organization*string | null
↳ issuer_common_name*string | null
↳ issuer_organization*string | null
↳ serial_number*stringHexadecimal
↳ not_before*stringISO-8601, UTC
↳ not_after*stringISO-8601, UTC
↳ days_until_expiry*integerNegative once expired
↳ validity_days*integerLength of the validity window
↳ expired*boolean
↳ not_yet_valid*boolean
↳ subject_alt_names*string[]Every DNS name and IP address the certificate covers
↳ key_type*stringrsa, ec, ed25519, ed448, dsa or unknown
↳ key_bits*integer | null
↳ curve*string | nullThe curve name for EC keys
↳ signature_algorithm*string | null
↳ signature_hash*string | nullsha256, sha384, sha1 …
↳ fingerprint_sha256*stringLower-case hex, no separators
↳ fingerprint_sha1*stringLower-case hex, no separators
↳ self_signed*booleanIssuer and subject are the same name
↳ wildcard*booleanAt least one name starts with *.
connection*TLSConnection | null
↳ tls_version*string | nulle.g. TLSv1.3
↳ cipher*string | nullThe negotiated cipher suite
↳ cipher_bits*integer | null
lookup_failed*booleanTrue when the host could not be reached; retry before acting
issues_found*Finding[]
↳ code*stringStable machine-readable code, e.g. CERT_EXPIRED
↳ type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
↳ message*stringWhat was found and why it matters
elapsed_msintegerdefault 0

Errors

  • 401missing or invalid API key / token
  • 402not enough credits on the account
  • 422the request body or a parameter failed validation
  • 429plan rate limit exceeded

Nested objects

data.certificate · CertificateInfo
FieldTypeDescription
subject_common_name*string | null
subject_organization*string | null
issuer_common_name*string | null
issuer_organization*string | null
serial_number*stringHexadecimal
not_before*stringISO-8601, UTC
not_after*stringISO-8601, UTC
days_until_expiry*integerNegative once expired
validity_days*integerLength of the validity window
expired*boolean
not_yet_valid*boolean
subject_alt_names*string[]Every DNS name and IP address the certificate covers
key_type*stringrsa, ec, ed25519, ed448, dsa or unknown
key_bits*integer | null
curve*string | nullThe curve name for EC keys
signature_algorithm*string | null
signature_hash*string | nullsha256, sha384, sha1 …
fingerprint_sha256*stringLower-case hex, no separators
fingerprint_sha1*stringLower-case hex, no separators
self_signed*booleanIssuer and subject are the same name
wildcard*booleanAt least one name starts with *.
data.connection · TLSConnection
FieldTypeDescription
tls_version*string | nulle.g. TLSv1.3
cipher*string | nullThe negotiated cipher suite
cipher_bits*integer | null
data.issues_found[] · Finding
FieldTypeDescription
code*stringStable machine-readable code, e.g. CERT_EXPIRED
type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
message*stringWhat was found and why it matters

Notes

  • port defaults to 443; pass another for mail servers with implicit TLS (465, 993, 995) or custom services. STARTTLS ports are not negotiated.
  • host may be an IP address; the name check then uses the certificate's IP entries.
  • Trust is judged against the server's system store, which follows the Mozilla bundle, and chain_trusted stays true for a certificate that is merely expired or for the wrong name.
  • One handshake per check: protocol and cipher scanning (does the host still accept TLS 1.0?) is not part of this report.
  • A report with lookup_failed: true could not reach the host; retry it before acting on it.