A self-signed certificate can be generated with openssl
.
For example, the following command will create a certificate valid for 365 days
with both the key and certificate data written to the same file:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem