Sometimes I want to test a certificate or a client before any real web server is set up. OpenSSL includes a small TLS server for exactly that.
Start it with a certificate and key on a free port:
openssl s_server -accept 8443 -cert cert.pem -key key.pem -www
With -www it answers every HTTP request with a status page that shows the TLS version, the cipher and the ciphers it supports. Test it from another terminal:
curl --cacert ca.pem https://localhost:8443/
It is handy for a few jobs: checking that a fresh certificate and key load and match, testing whether a client trusts your CA, or checking a firewall or port forward before the real service exists. With -WWW (capitals) it serves files from the current folder instead of the status page. To serve a chain, add the intermediates with -cert_chain chain.pem.
This is a test tool, not a web server. It handles one connection at a time, has no access control, and with -WWW serves whatever is in that folder to anyone who can reach the port. Bind it to a port only your own machine or LAN can reach, and stop it with Ctrl+C when you are done.
Further reading: OpenSSL: openssl-s_server