Skip to content

Instantly share code, notes, and snippets.

@gentamura
Created November 3, 2012 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gentamura/4006976 to your computer and use it in GitHub Desktop.
Save gentamura/4006976 to your computer and use it in GitHub Desktop.
Herokuの本番環境にRailsでSSL(https)を導入する方法 ref: http://qiita.com/items/7a12ca611705017bcb0e
$ openssl genrsa -des3 -out server.orig.key 2048
...
Enter pass phrase for server.key: 適当なパスワードを。
Verifying - Enter pass phrase for server.key: もう一度同じパスワードを。
$ openssl rsa -in server.orig.key -out server.key
$ openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP ※国名
State or Province Name (full name) [Some-State]:Hokkaido ※都道府県
Locality Name (eg, city) []:Hakodate ※市区町村
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Helply LLC. ※会社名
Organizational Unit Name (eg, section) []: ※部署(入力せず)
Common Name (eg, YOUR name) []:www.helply.net ※証明書に表示される名前
Email Address []:gen.tamura@helply.net ※メールアドレス
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:※入力せず
An optional company name []:※入力せず
curl https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem > rapidssl_bundle.pem
cat server.orig.crt rapidssl_bundle.pem > server.crt
$ heroku addons:add ssl
Adding ssl on young-planet-6921... done, v1 ($20/mo)
Next add your certificate with `heroku certs:add PEM KEY`.
Use `heroku addons:docs ssl` to view documentation.
$ heroku domains:add www.mydomain.com
Added www.mydomain.com to myapp... done
$ heroku plugins:install https://github.com/heroku/heroku-ssl-doctor.git
$ heroku certs:add server.crt server.key
Adding SSL Endpoint to myapp... done
myapp now served by tokyo-2121.herokussl.com.
Certificate details:
Expires At: 2012-10-31 21:53:18 GMT
Issuer: C=US; ST=CA; L=SF; O=Heroku; CN=www.mydomain.com
Starts At: 2011-11-01 21:53:18 GMT
Subject: C=US; ST=CA; L=SF; O=Heroku; CN=www.mydomain.com
SSL certificate is self signed.
config.force_ssl = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment