4 ms·
Proof-of-concept code like this can't anticipate everything about the environment it's going to run in, without risking distracting from its point. I guess it w
by scintill76 9y ago
Proof-of-concept code like this can't anticipate everything about the environment it's going to run in, without risking distracting from its point. I guess it would be better to just put the files in the current directory, to not encourage the use of /tmp. The script[0] looks safer.
While we're on the subject of the openssl tool and file permissions, I've been disappointed... On my system, this command creates key.pem word-readable: "openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -nodes" I've been meaning to set my umask to fix issues like this, as I have rare need to let another user account access my files. On the other hand, there aren't supposed to be any other users on my systems, and it's more likely my browser will get pwned and have access to my self-readable private keys anyway.
[0] https://github.com/hannob/tlshelpers/blob/46c50b27adf79476aed5a8a47bd6754e2be925fb/matchcertkey https://github.com/hannob/tlshelpers/blob/46c50b27adf79476ae...