Merge pull request #282 from lirantal/ssl-support-fixes

SSL support fixes
This commit is contained in:
Liran Tal
2014-12-06 10:23:32 +02:00
4 changed files with 14 additions and 4 deletions

2
.gitignore vendored
View File

@@ -18,7 +18,7 @@ app/tests/coverage/
# MEAN.js app and assets
# ======================
config/sslcert/*.pem
config/sslcerts/*.pem
access.log
# Sublime editor

View File

@@ -104,10 +104,10 @@ $ docker run -p 3000:3000 -p 35729:35729 -v /Users/mdl/workspace/mean-stack/mean
## Running in a secure environment
To run your application in a secure manner you'll need to use OpenSSL and generate a set of self-signed certificates. Unix-based users can use the following commnad:
```
$ sh generate-ssl-certs.sh
$ sh ./scripts/generate-ssl-certs.sh
```
Windows users can follow instructions found [here](http://www.websense.com/support/article/kbarticle/How-to-use-OpenSSL-and-Microsoft-Certification-Authority)
To generate the key and certificate and place them in the *config/sslcert* folder.
To generate the key and certificate and place them in the *config/sslcerts* folder.
## Getting Started With MEAN.JS
You have your application running but there is a lot of stuff to understand, we recommend you'll go over the [Official Documentation](http://meanjs.org/docs.html).

View File

@@ -1,7 +1,7 @@
'use strict';
module.exports = {
port: 443,
port: 8443,
db: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI || 'mongodb://localhost/mean',
log: {
// Can specify one of 'combined', 'common', 'dev', 'short', 'tiny'

View File

@@ -1,5 +1,15 @@
#!/bin/bash
if [ ! -e server.js ]
then
echo "Error: could not find main application server.js file"
echo "You should run the generate-ssl-certs.sh script from the main MEAN application root directory"
echo "i.e: bash scripts/generate-ssl-cers.sh"
exit -1
fi
echo "Generating self-signed certificates..."
mkdir -p ./config/sslcerts
openssl genrsa -out ./config/sslcerts/key.pem -aes256 1024
openssl req -new -key ./config/sslcerts/key.pem -out ./config/sslcerts/csr.pem
openssl x509 -req -days 9999 -in ./config/sslcerts/csr.pem -signkey ./config/sslcerts/key.pem -out ./config/sslcerts/cert.pem