$98.26

macOS what is the correct way to make self-signed certificate as trusted for local development

Ask a question+
5

I am trying to set up local https for my project. I have macOS 10.14.2. Before this, I was successfully added a few self-signed certificates by generating the Certificate and Key files, then configuring Nginx virtual host (I guess the same is for apache) and finally adding the certificate into keychain rebutting. Now it keeps showing that certificate is not valid, maybe something has been changed in macOS?

add comment

1 Answer

1

The way I have done this before is as follows:

Assuming I have the Which command installed:

which openssl
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr

Then finally
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

This will generate a .crt file that will be valid

Lainrawr 225
add comment

Your Answer