Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

Be respectful. Technical disagreements are fine, personal attacks are not.

If someone is being disruptive, report it to gdsksdeveloper@gmail.com.
If someone is being disruptive, report it to support@glincker.com.
239 changes: 180 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
<p align="center">
<h1 align="center">sslx</h1>
<p align="center">openssl, but you don't have to google the flags</p>
</p>
# sslx

<p align="center">
<a href="https://crates.io/crates/sslx"><img src="https://img.shields.io/crates/v/sslx.svg" alt="crates.io"></a>
<a href="https://github.com/glincker/sslx/actions"><img src="https://github.com/glincker/sslx/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://github.com/glincker/sslx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
</p>
**openssl, but you don't have to google the flags.**

---
A single binary that handles certs, TLS connections, and all the stuff you normally need three different openssl invocations for. Built with Rust and [rustls](https://github.com/rustls/rustls), no system OpenSSL required.

[![crates.io](https://img.shields.io/crates/v/sslx.svg)](https://crates.io/crates/sslx)
[![CI](https://github.com/glincker/sslx/actions/workflows/ci.yml/badge.svg)](https://github.com/glincker/sslx/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/glincker/sslx/blob/main/LICENSE)

![sslx demo](demo.gif)

## Install

```bash
cargo install sslx
```

Prebuilt binaries on the [releases page](https://github.com/glincker/sslx/releases).

Homebrew:
```bash
brew install glincker/tap/sslx
```

Or download directly:
```bash
# macOS (Apple Silicon)
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-macos-aarch64 -o sslx && chmod +x sslx

# Linux
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-linux-x86_64 -o sslx && chmod +x sslx
Comment on lines +26 to +32

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direct-download install snippet pulls a binary and marks it executable without any integrity verification. Consider adding checksum/signature verification instructions (or at least a note pointing to release checksums) to reduce the risk of users running a tampered download.

Suggested change
Or download directly:
```bash
# macOS (Apple Silicon)
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-macos-aarch64 -o sslx && chmod +x sslx
# Linux
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-linux-x86_64 -o sslx && chmod +x sslx
Or download directly, then verify the file against the checksums/signatures published on the [releases page](https://github.com/glincker/sslx/releases) before marking it executable or running it:
```bash
# macOS (Apple Silicon)
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-macos-aarch64 -o sslx
# Linux
curl -fsSL https://github.com/glincker/sslx/releases/latest/download/sslx-linux-x86_64 -o sslx
# After verifying the downloaded file matches the published checksum/signature:
chmod +x sslx

Copilot uses AI. Check for mistakes.
```

## TLS grade

Rate the TLS setup of any host, like SSL Labs but from your terminal:

```
$ sslx grade github.com
Expand All @@ -27,105 +52,197 @@ $ sslx grade github.com
✓ ALPN HTTP/2 supported
```

## Install

```bash
cargo install sslx
```

Prebuilt binaries on the [releases page](https://github.com/glincker/sslx/releases). Homebrew: `brew install glincker/tap/sslx`
Checks protocol version, cipher strength, cert validity, key type, hostname matching, chain completeness, and ALPN. Gives you a letter grade from A+ to F.

## Examples

The openssl command you can never remember vs sslx:

```bash
# openssl x509 -in cert.pem -text -noout
sslx inspect cert.pem

# openssl s_client -connect host:443 2>/dev/null | openssl x509 -text
sslx connect example.com

# openssl verify -CAfile ca.pem cert.pem
sslx verify cert.pem --ca ca.pem

# openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 ...
sslx generate --cn localhost
```
## Expiry check

Check cert expiry on a bunch of hosts at once:

```
$ sslx expiry google.com github.com cloudflare.com
$ sslx expiry google.com github.com cloudflare.com stripe.com

Host Expires Days Status
────────────────────────────────────────────────────────────────
✓ google.com:443 2026-06-15 61 OK
✓ github.com:443 2026-06-03 49 OK
✓ cloudflare.com:443 2026-06-10 56 OK
✓ stripe.com:443 2026-09-01 139 OK
```

Returns exit code 1 if anything expires within 7 days, so it works in cron/CI.
Exit code 1 if anything expires within 7 days. Useful in cron jobs or CI pipelines.

## Inspect certificates

Look at a cert file:
Read a PEM or DER cert file with colored output:

```
$ sslx inspect cert.pem

╭─ Certificate 1 of 1 ──────────────────────────────────╮
│ Subject: CN=*.example.com │
│ Issuer: CN=Let's Encrypt Authority X3 │
│ Serial: 0A:1B:2C:3D... │
│ │
│ Valid: 2026-01-15 → 2026-04-15 │
│ Expires: ██░░░░░░░░ 12 days remaining [!] │
│ │
│ Key: ECDSA P-256 (256 bit) │
│ SANs: *.example.com, example.com │
│ SHA-256: AB:CD:EF:12:34... │
╰──────────────────────────────────────────────────────────╯
```

Throw a JWT at it and it figures it out:
Handles multi-cert bundles too. Auto-detects PEM vs DER.

## Connect to a host

See the full TLS handshake details and cert chain for any host:

```
$ sslx connect example.com

Connection to example.com:443

TLS 1.3 · TLS13_AES_256_GCM_SHA384
ALPN: h2

Chain:
╭─ Certificate 1 of 3 ─────────────────────────╮
│ Subject: CN=*.example.com │
│ Valid: 61 days remaining ✓ │
│ Key: ECDSA P-256 (256 bit) │
╰────────────────────────────────────────────────╯
↓ signed by
╭─ Certificate 2 of 3 (CA) ────────────────────╮
│ ... │
╰────────────────────────────────────────────────╯
```

## Generate certs

Self-signed cert for local dev in one command:

```bash
sslx generate --cn localhost --san "*.local,127.0.0.1"
```

Creates `cert.pem` and `key.pem` with EC P-256 by default. Also supports `ec384` and `ed25519`.

## Generate a CSR

```bash
sslx csr --cn example.com --san "*.example.com,api.example.com"
```

Creates `csr.pem` and `key.pem`. Submit the CSR to your CA.

## Convert between formats

```bash
sslx convert cert.pem --to der # PEM to DER
sslx convert cert.der --to pem # DER to PEM
sslx convert bundle.p12 --to pem # PKCS12 to PEM
```

Auto-detects input format.

## Check cert+key match

```
$ sslx match cert.pem key.pem

✓ Certificate and key match (ECDSA P-256 (256 bit))
```

No more comparing modulus hashes manually.

## Extract from PKCS12

```bash
sslx extract bundle.p12 --password mypass --out ./certs
```

Pulls out the leaf cert, intermediates, and key into separate PEM files.

## Decode anything

Throw a file or a JWT token at it and sslx figures out what it is:

```
$ sslx decode eyJhbGciOiJIUzI1...
$ sslx decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

✓ Detected: JSON Web Token (JWT)

Header: {"alg":"HS256","typ":"JWT"}
Payload: {"sub":"1234567890","name":"John","iat":1516239022}
Expires: in 3 hours
```

Also detects PEM certs, DER files, private keys, public keys, and CSRs.

## Verify a chain

```bash
sslx verify cert.pem --ca ca-bundle.pem
```

```
✓ Certificate is valid
Chain: complete (3 certs)
Expiry: 328 days remaining
```

## Commands
Tells you exactly what's wrong if it fails, with hints on how to fix it.

| Command | |
|---------|---|
| `inspect <file>` | show cert details |
| `connect <host>` | TLS handshake + cert chain |
| `verify <file>` | check a cert chain |
| `generate` | self-signed cert |
| `grade <host>` | A+ to F TLS grade |
| `expiry <hosts...>` | cert expiry check |
| `convert <file>` | PEM/DER/PKCS12 conversion |
| `match <cert> <key>` | cert+key pair check |
| `extract <file>` | pull certs out of a .p12 |
| `csr` | certificate signing request |
| `decode <file\|token>` | figure out what a file is |
## openssl vs sslx

Everything supports `--json`:
| What you're doing | openssl | sslx |
|---|---|---|
| Look at a cert | `openssl x509 -in cert.pem -text -noout` | `sslx inspect cert.pem` |
| TLS handshake | `openssl s_client -connect host:443 2>/dev/null \| openssl x509 -text` | `sslx connect host` |
| Verify chain | `openssl verify -CAfile ca.pem cert.pem` | `sslx verify cert.pem --ca ca.pem` |
| Self-signed cert | `openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -keyout key.pem -out cert.pem -days 365 -nodes -batch -subj "/CN=localhost"` | `sslx generate --cn localhost` |
| Create CSR | `openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:P-256 -keyout key.pem -out csr.pem -batch -subj "/CN=example.com"` | `sslx csr --cn example.com` |
| PEM to DER | `openssl x509 -in cert.pem -outform DER -out cert.der` | `sslx convert cert.pem --to der` |
| Check expiry | `echo \| openssl s_client -connect host:443 2>/dev/null \| openssl x509 -noout -enddate` | `sslx expiry host` |
| Cert+key match | `diff <(openssl x509 -noout -modulus -in cert.pem) <(openssl rsa -noout -modulus -in key.pem)` | `sslx match cert.pem key.pem` |
| TLS grade | (go to ssllabs.com) | `sslx grade host` |
| Decode JWT | (go to jwt.io) | `sslx decode <token>` |

## JSON output

Every command supports `--json` for scripting and CI:

```bash
# check days until expiry
sslx connect example.com --json | jq '.chain.certificates[0].days_remaining'

# get the grade
sslx grade example.com --json | jq '.grade'

# list all SANs
sslx inspect cert.pem --json | jq '.certificates[0].sans'
```

## Speed
## Exit codes

| Code | Meaning |
|---|---|
| 0 | ok |
| 1 | cert expired or expiring |
| 3 | chain untrusted |
| 4 | connection failed |
| 5 | bad file |
Comment on lines +232 to +235

Copilot AI Apr 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exit-code table doesn’t match the actual CLI behavior. Several commands return 1 for reasons other than “cert expired or expiring” (e.g., grade returns 1 for low scores, match returns 1 on mismatch), and there is no code path returning 4 (connection failures appear to bubble up as errors and exit 10). Please update this section to reflect the real exit codes (either per-command, or a more general mapping) and remove/adjust codes that aren’t used.

Suggested change
| 1 | cert expired or expiring |
| 3 | chain untrusted |
| 4 | connection failed |
| 5 | bad file |
| 1 | command-specific non-success result (for example: cert expired or expiring, low grade, or match failure) |
| 3 | chain untrusted |
| 5 | bad file or invalid input |
| 10 | command/runtime error (including connection failures) |

Copilot uses AI. Check for mistakes.

## Benchmarks

Median of 10 runs on macOS M2:

| | sslx | openssl |
|---|------|---------|
|---|---|---|
| inspect cert | 2.1ms | 9.4ms |
| generate cert | 1.7ms | 4.5ms |
| cold start | 1.3ms | |

Uses [rustls](https://github.com/rustls/rustls), not system OpenSSL.
| startup | 1.3ms | |

## Shell completions

Expand All @@ -135,6 +252,10 @@ sslx completions zsh > ~/.zsh/completions/_sslx
sslx completions fish > ~/.config/fish/completions/sslx.fish
```

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md). Bugs and feature requests go in [issues](https://github.com/glincker/sslx/issues).

## License

MIT
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security

Found a vulnerability? Email gdsksdeveloper@gmail.com instead of opening a public issue.
Found a vulnerability? Email support@glincker.com instead of opening a public issue.

Tell me what you found, how to reproduce it, and how bad you think it is. I'll get back to you within 48 hours.

Expand Down
Binary file added demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions demo.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Output demo.gif

Set Shell "bash"
Set FontSize 15
Set Width 950
Set Height 600
Set Theme "Catppuccin Mocha"
Set Padding 24
Set TypingSpeed 60ms

Sleep 1s

Type "sslx grade github.com"
Sleep 500ms
Enter
Sleep 4s

Type "sslx expiry google.com github.com cloudflare.com"
Sleep 500ms
Enter
Sleep 4s

Type "sslx inspect /tmp/demo-certs/cert.pem"
Sleep 500ms
Enter
Sleep 4s

Sleep 2s
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
edition = "2021"
max_width = 100
use_field_init_shorthand = true
Loading