diff --git a/tests/README.md b/tests/README.md index 083269d6e8..47fcacf409 100644 --- a/tests/README.md +++ b/tests/README.md @@ -181,9 +181,9 @@ SSL/TLS tests in `multi_net` and `net_inet` use a self-signed key/cert pair that is randomly generated and to be used for testing/demonstration only. You should always generate your own key/cert. -To generate a new self-signed key/cert pair with openssl do: +To generate a new self-signed RSA key/cert pair with openssl do: ``` -$ openssl req -x509 -newkey rsa:4096 -keyout rsa_key.pem -out rsa_cert.pem -days 365 -nodes +$ openssl req -x509 -newkey rsa:2048 -keyout rsa_key.pem -out rsa_cert.pem -days 365 -nodes -subj '/CN=micropython.local/O=MicroPython/C=AU' ``` In this case CN is: micropython.local @@ -192,3 +192,9 @@ Convert them to DER format: $ openssl rsa -in rsa_key.pem -out rsa_key.der -outform DER $ openssl x509 -in rsa_cert.pem -out rsa_cert.der -outform DER ``` + +To test elliptic curve key/cert pairs, create a key then a certificate using: +``` +$ openssl ecparam -name prime256v1 -genkey -noout -out ec_key.der -outform DER +$ openssl req -new -x509 -key ec_key.der -out ec_cert.der -outform DER -days 365 -nodes -subj '/CN=micropython.local/O=MicroPython/C=AU' +``` diff --git a/tests/multi_net/rsa_cert.der b/tests/multi_net/rsa_cert.der index 24ed957eb2..8fae71d4ba 100644 Binary files a/tests/multi_net/rsa_cert.der and b/tests/multi_net/rsa_cert.der differ diff --git a/tests/multi_net/rsa_key.der b/tests/multi_net/rsa_key.der index 5a4666402a..c2cfb76d20 100644 Binary files a/tests/multi_net/rsa_key.der and b/tests/multi_net/rsa_key.der differ