WHAT'S NEW?
Loading...

Creating a local SSL certificate for local.mysite.com

Index

  • Intro
  • Solution
  • References

Intro



I've been working on the integration of a payment service provider (Amazon) and oAuth system (Facebook, Twitter, Google,...) for different projects and in some cases, you are forced to provided a different URL than "localhost" to those provider in order to get access to their API.

In this tutorial I'll show you how to create a local SSL certificate and how to host your web site in a different URL than https://localhost:XXXX.

Solution

Create local SSL certificate and configure VS:
  1. Add entry to hosts file
  2. 127.0.0.1 local.mysite.com
  3. Edit project applicationhost.config and add new binding
  4. Run in VS developer command prompt (ensure you run as an administrator):


  5. Start > Run > MMC.exe
  6. File > Add/remove snap-in
  7. Select certificates and then local computer
  8. Find the certificate under Personal > Certificates
  9. Double click and get the thumbprint under the details tab. It should look like below:
  10. 68 98 9c 08 09 70 88 67 1c 0f 08 a5 9b 0a 74 9a 9b 1e a5 65
  11. Remove all spaces e.g.
  12. 68989c08097088671c0f08a59b0a749a9b1ea565
  13. Back in developer command prompt, run (ensure the certhash is replaced with the one you got from above. The AppId can be anything so keep it the same as below)


  14. Add urlacl entry (important to keep trailing slash on url)

  15. Move the certificate in MMC.exe from the personal to trusted folder
  16. Test the URL https://local.mysite.com:44300/. It should now work with a valid SSL certificate

That's all for today folks! I hope you found this interesting and helpful in your next projects. See ya!

References

0 comments:

Post a Comment