# SSL Certificate Check (`ssl.certificate`)

Open a TLS connection to a host and read its certificate: issuer, validity dates, days remaining, alternative names, chain, protocol and trust verdict.

- **Route:** `POST /v1/run/ssl.certificate`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs network checks (`netcheck`) · failover: no
- **Measured latency:** p50 50 ms · p95 50 ms · p99 50 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `host` | string | yes |  | Host name |
| `port` | integer | no | 443 | TLS port (443, 465, 636, 853, 993, 995, 5061 or 8443) |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `valid` | True when the certificate is trusted, matches the host and has not expired. |
| `issuer` | Issuing certificate authority. |
| `valid_to` | Expiry date. |
| `days_remaining` | Days until expiry. |
| `subject_alt_names` | DNS names the certificate covers. |
| `protocol` | Negotiated TLS version. |
| `error` | Why the chain is not trusted, if so. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/ssl.certificate \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"host":"github.com"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('ssl.certificate', {'host': 'github.com'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run ssl.certificate '{"host":"github.com"}'
```

Quote first (free, validates input): `POST /v1/quote/ssl.certificate` with the same body.
