Veck Hsiao
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # xshogi 官網加入 SSL certificate 紀錄 實驗域名:xshogi.com.tw ## 第一階段 I purchased a domain name from Gandi and use permanent web forwarding to forward the domain name to my heroku application. I also add custom domain(the one I bought) to heroku console. Domain Name DNS Record Type DNS Target ───────────────── ─────────────── ─────────────────────── xshogi.com.tw ALIAS or ANAME xshogi.com.tw.herokudns.com www.xshogi.com.tw CNAME www.xshogi.com.tw.herokudns.com I could not successfully adopt heroku ACM to configure my domain even though I had paid for hobby plan. I followed the tutorial [video](https://vimeo.com/209534466) that Johnnybib posted. 1. create server.crs and server.key in project with `openssl req -nodes -newkey rsa:2048 -sha256 -keyout server.key -out server.csr` 2. go to purchase SSL certificate page in Gandi 3. `cat server.csr` and paste it to Gandi console 4. pay and wait for authentication done to finish this bill 5. download .crt and .pem certificate and concatenate them together into all.crt 6. use `heroku certs:add --app xshogi all.crt` ## 第二階段 ### 新增 certification 和 key 到 heroku ``` ↪ heroku certs:add all.crt .ssl/xshogi_heroku.key --app xshogi 19:35:21 ▸ heroku-cli: update available from 6.15.28-6b9662e to 6.16.13-dbb9c23 Resolving trust chain... done Adding SSL certificate to ⬢ xshogi... done Certificate details: Common Name(s): www.xshogi.com.tw xshogi.com.tw Expires At: 2019-04-19 07:59 UTC Issuer: /C=FR/ST=Paris/L=Paris/O=Gandi/CN=Gandi Standard SSL CA 2 Starts At: 2018-04-18 08:00 UTC Subject: /OU=Domain Control Validated/OU=Gandi Standard SSL/CN=www.xshogi.com.tw SSL certificate is verified by a root authority. === The following common names already have domain entries www.xshogi.com.tw xshogi.com.tw === Your certificate has been added successfully. Update your application's DNS settings as follows Domain Record Type DNS Target ───────────────── ─────────── ──────────────────────────────────── www.山角行.com CNAME www.xn--rhto43ho7a.com.herokudns.com xshogi.com.tw ALIAS/ANAME xshogi.com.tw.herokudns.com www.xshogi.com.tw CNAME www.xshogi.com.tw.herokudns.com 山角行.com ALIAS/ANAME xn--rhto43ho7a.com.herokudns.com ``` ### 檢查憑證 ``` ↪ heroku certs:info 19:36:12 ▸ heroku-cli: update available from 6.15.28-6b9662e to 6.16.13-dbb9c23 Fetching SSL certificate ceratosaurus-25252 info for ⬢ xshogi... done Certificate details: Common Name(s): www.xshogi.com.tw xshogi.com.tw Expires At: 2019-04-19 07:59 UTC Issuer: /C=FR/ST=Paris/L=Paris/O=Gandi/CN=Gandi Standard SSL CA 2 Starts At: 2018-04-18 08:00 UTC Subject: /OU=Domain Control Validated/OU=Gandi Standard SSL/CN=www.xshogi.com.tw SSL certificate is verified by a root authority. ``` ### 測試憑證 ``` ↪ openssl s_client -connect www.xshogi.com.tw.herokudns.com:443 -servername www.xshogi.com.tw 19:36:25 CONNECTED(00000003) depth=2 /C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority verify error:num=20:unable to get local issuer certificate verify return:0 --- Certificate chain 0 s:/OU=Domain Control Validated/OU=Gandi Standard SSL/CN=www.xshogi.com.tw i:/C=FR/ST=Paris/L=Paris/O=Gandi/CN=Gandi Standard SSL CA 2 1 s:/C=FR/ST=Paris/L=Paris/O=Gandi/CN=Gandi Standard SSL CA 2 i:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority 2 s:/C=US/ST=New Jersey/L=Jersey City/O=The USERTRUST Network/CN=USERTrust RSA Certification Authority i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root --- Server certificate -----BEGIN CERTIFICATE----- MIIGATCCBOmgAwIBAgIRAK42Y5Tzqt7mp+/o1XTh/Y8wDQYJKoZIhvcNAQELBQAw XzELMAkGA1UEBhMCRlIxDjAMBgNVBAgTBVBhcmlzMQ4wDAYDVQQHEwVQYXJpczEO MAwGA1UEChMFR2FuZGkxIDAeBgNVBAMTF0dhbmRpIFN0YW5kYXJkIFNTTCBDQSAy MB4XDTE4MDQxODAwMDAwMFoXDTE5MDQxODIzNTk1OVowXDEhMB8GA1UECxMYRG9t YWluIENvbnRyb2wgVmFsaWRhdGVkMRswGQYDVQQLExJHYW5kaSBTdGFuZGFyZCBT U0wxGjAYBgNVBAMTEXd3dy54c2hvZ2kuY29tLnR3MIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAqv2/I8JrMjbmJD2Z9A0etNp3C2NghVd/W69uWgNTlIi5 pZoCmB/4NjyeG/DkixPCAu5S0dT8BNsH5EfA+Yr89aICdeN+satuAOhBuPqB397o 7xVGuqsTfl6vrV7jsa7qURIz4HVszo22dTl2J+4sECY7jd/T5Qz8xKrEHaFymrN2 /EeY1PMEC3t4Hu1wiNBZoGAXonttO+bGzXI9xGJCWAG/1G0qA7HKp3MfonEXJXw7 WGklirLtoHIboKykvl4/PsZH9S6qwbvD6hStqNgjnn4uD7lqNcLChLQBt4SHgMjy ZRPF6IDFpGZr+/lzvBogL2V3lJpsf/LTYbiZQ7L7VQIDAQABo4ICuTCCArUwHwYD VR0jBBgwFoAUs5Cn2MmvTs1hPJ98rV1/Qf1pMOowHQYDVR0OBBYEFNimFTHeRUj1 04k5mtzT9eKN5jLcMA4GA1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1RUAjgwfuFP64yZLPCYBy3La/V9zuqH6r2mIS7+Pt2KYc+LXEAgsUKr17Xjnj5Pc Ujip4UwtKMYeaOiO3Mmfh+cLP9MI5dXtPORwpcBF4TfvxGSnbPAZ0B92NeiuPsLX mcesk7M= -----END CERTIFICATE----- subject=/OU=Domain Control Validated/OU=Gandi Standard SSL/CN=www.xshogi.com.tw issuer=/C=FR/ST=Paris/L=Paris/O=Gandi/CN=Gandi Standard SSL CA 2 --- No client certificate CA names sent --- SSL handshake has read 4636 bytes and written 452 bytes --- New, TLSv1/SSLv3, Cipher is AES256-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : AES256-SHA Session-ID: F9E02084D92B2715BDC48DC239C2E969ADE4C35A9914C3B3185E13D5B6ECB98B Session-ID-ctx: Master-Key: DA54735704328C775DCB14BDCC5EC5C0BC80F6811D765263B003CB23727FD99574BFAF28C010399F103C3A6DA9E0EA19 Key-Arg : None Start Time: 1524051500 Timeout : 300 (sec) Verify return code: 0 (ok) --- read:errno=0 ``` ## 最後一階段 ``` ↪ curl -vI https://www.xshogi.com.tw 20:05:19 * Rebuilt URL to: https://www.xshogi.com.tw/ * Trying 217.70.184.50... * TCP_NODELAY set * Connection failed * connect to 217.70.184.50 port 443 failed: Connection refused * Failed to connect to www.xshogi.com.tw port 443: Connection refused * Closing connection 0 curl: (7) Failed to connect to www.xshogi.com.tw port 443: Connection refused ``` 在甘地修改 www 的 CNAME 從 webredir.vip.gandi.net. 改為 xshogi.com.tw.herokudns.com. ``` veckh at 8c85900fb29e in ~/D/x/official_website ↪ curl -vI https://www.xshogi.com.tw 20:06:50 * Rebuilt URL to: https://www.xshogi.com.tw/ * Trying 50.19.93.33... * TCP_NODELAY set * Connected to www.xshogi.com.tw (50.19.93.33) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: www.xshogi.com.tw * Server certificate: Gandi Standard SSL CA 2 * Server certificate: USERTrust RSA Certification Authority > HEAD / HTTP/1.1 > Host: www.xshogi.com.tw > User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) > Accept: */* > Referer: > < HTTP/1.1 200 OK HTTP/1.1 200 OK < Server: Cowboy Server: Cowboy < Date: Wed, 18 Apr 2018 12:06:54 GMT Date: Wed, 18 Apr 2018 12:06:54 GMT < Connection: keep-alive Connection: keep-alive < X-Frame-Options: SAMEORIGIN X-Frame-Options: SAMEORIGIN < X-Xss-Protection: 1; mode=block X-Xss-Protection: 1; mode=block < X-Content-Type-Options: nosniff X-Content-Type-Options: nosniff < Content-Type: text/html; charset=utf-8 Content-Type: text/html; charset=utf-8 < Etag: W/"edaffa07c2f02d7e700e89b6f7997060" Etag: W/"edaffa07c2f02d7e700e89b6f7997060" < Cache-Control: max-age=0, private, must-revalidate Cache-Control: max-age=0, private, must-revalidate < Set-Cookie: _Xshogi_Server_session=aERuNjZoYnhqMlhqT2FsZERVbnhuNWI1RW1rcm1RRHV6QytQelNvNjdHQW5jVGVqazdIeFVoRUxQYllVMTB0MmdoMEE1Zm1IemFGOUp6VDFDa09EYk5NaDEvTVpzS3hLRVd5UTFlSndHWGJaT0NlSkdrb09HamhVUnIvR0NyQzVEbm1PU0pjSC83eitSb2tKTno1VGZRPT0tLTZhS2IzTzZyWHloWTZWUWhOWE1FQkE9PQ%3D%3D--814dcb9c87b0e66a8966a8c680ff7ed4e0023154; path=/; HttpOnly Set-Cookie: _Xshogi_Server_session=aERuNjZoYnhqMlhqT2FsZERVbnhuNWI1RW1rcm1RRHV6QytQelNvNjdHQW5jVGVqazdIeFVoRUxQYllVMTB0MmdoMEE1Zm1IemFGOUp6VDFDa09EYk5NaDEvTVpzS3hLRVd5UTFlSndHWGJaT0NlSkdrb09HamhVUnIvR0NyQzVEbm1PU0pjSC83eitSb2tKTno1VGZRPT0tLTZhS2IzTzZyWHloWTZWUWhOWE1FQkE9PQ%3D%3D--814dcb9c87b0e66a8966a8c680ff7ed4e0023154; path=/; HttpOnly < X-Request-Id: 05adeb8e-6512-4b0c-895b-1c483e27105f X-Request-Id: 05adeb8e-6512-4b0c-895b-1c483e27105f < X-Runtime: 0.015953 X-Runtime: 0.015953 < Content-Length: 10685 Content-Length: 10685 < Via: 1.1 vegur Via: 1.1 vegur < * Connection #0 to host www.xshogi.com.tw left intact ``` 然後瀏覽器連線 https://www.xshogi.com.tw 就可以通了,且保留 https://www.xshogi.com.tw https 修改 CNAME 後好像就不需要在 網頁轉址 那邊新增項目了...我刪光還是 work 但是如果要把 http 導向 https 的,還是要去新增網頁轉址

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully