Add script for generating test certificates

This commit is contained in:
Alban Diquet 2019-11-05 15:44:45 -08:00
parent bbc8ffab2c
commit dfb4c5422c
1 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import trustme
# Create a CA
ca = trustme.CA()
# Issue a cert signed by this CA
server_cert = ca.issue_cert(u"www.good.com")
# Save the PEM-encoded data to a file
ca.cert_pem.write_to_path("GoodRootCA.pem")
server_cert.private_key_and_cert_chain_pem.write_to_path("www.good.com.pem")