Skip to content

Instantly share code, notes, and snippets.

@gwollman
Last active January 22, 2021 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwollman/a5b6888fd03e229bf62d9f2641dcfe13 to your computer and use it in GitHub Desktop.
Save gwollman/a5b6888fd03e229bf62d9f2641dcfe13 to your computer and use it in GitHub Desktop.
Use openssl s_client to check the TLS certificates of an SMTP server using STARTTLS
#!/bin/sh
echo QUIT | openssl s_client -connect "$1":25 -starttls smtp -name "$1" -showcerts -verify 1 -verify_return_error
# To send a client certificate, add:
# -cert /path/to/cert -key /path/to/key -cert_chain /path/to/chain
# for example, if you are using acmetool(1),
# acmedir=/var/db/acme/live/$(hostname)
# -cert $acmedir/cert -key $acmedir/privkey -cert_chain $acmedir/full_chain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment