Although this message was sent for Windows, this is an OS X question that I have not seen elsewhere. Here are the steps to create a self-signed certificate for localhost on OS X :
# Use 'localhost' for the 'Common name' openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
In Keychain Access double-click this new localhost certificate. Expand the arrow next to Trust and select Always Trust. Chrome and Safari must now trust this certificate. For example, if you want to use this certificate using node.js:
var options = { key: fs.readFileSync('/path/to/localhost.key').toString(), cert: fs.readFileSync('/path/to/localhost.crt').toString(), ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384', honorCipherOrder: true, secureProtocol: 'TLSv1_2_method' }; var server = require('https').createServer(options, app);
Ben Flynn Aug 23 '15 at 17:28 2015-08-23 17:28
source share