If you are using windows, you can continue reading this reply.
I've searched for a number of ways to do this, all of which require the use of openssl, which I think is a bit cumbersome.
I made it now, completely open source.
.\httpscert -d www.example.com -p password
You will get "www.example.com.key"、"www.example.com.crt" and "www.example.com.pfx".
Github: https://github.com/lalakii/HttpsCert/releases
I am adding it to this issue and I believe it will help someone in need at a later date