This page provides a few methods to create X509 certificates for testing purposes.
For this you need to have OpenSSL installed. On Windows, convenient installers are available at http://www.slproweb.com/products/Win32OpenSSL.html or http://gnuwin32.sourceforge.net/packages/openssl.htm.
Many tutorials exist on the web, such as these:
The easiest solution I've found so far is that one-line example:
openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout test.pem -out test.pem
Or if you prefer to have separate files for the private key and the certificate:
openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout test.key -out test.cert