4

You can run netcat in the "listen" mode:

nc -l 8080

This will listen on localhost:8080, dump everything that comes in to stdout and reply with data from netcat's stdin. This is useful for a quick and easy HTTP testing - you can initiate a request and paste the response you want into the console.

Is there something similar that can be used with HTTPS? Preferably something cross-platform that's likely to be installed on most systems.

Nickolay
  • 541

1 Answers1

4

OpenSSL provides a test SSL server in the style of netcat.

You have to generate a certificate (more details here), you can use the default answers for everything:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

Then run this to start the server:

openssl s_server -accept 8080 -key key.pem -cert cert.pem
Nickolay
  • 541