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:
- Add entry to hosts file
- Edit project applicationhost.config and add new binding
- Run in VS developer command prompt (ensure you run as an administrator):
- Start > Run > MMC.exe
- File > Add/remove snap-in
- Select certificates and then local computer
- Find the certificate under Personal > Certificates
- Double click and get the thumbprint under the details tab. It should look like below:
- Remove all spaces e.g.
- 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)
- Add urlacl entry (important to keep trailing slash on url)
- Move the certificate in MMC.exe from the personal to trusted folder
- Test the URL https://local.mysite.com:
44300/. It should now work with a valid SSL certificate
127.0.0.1 local.mysite.com
68 98 9c 08 09 70 88 67 1c 0f 08 a5 9b 0a 74 9a 9b 1e a5 65
68989c08097088671c0f08a59b0a749a9b1ea565
That's all for today folks! I hope you found this interesting and helpful in your next projects. See ya!
0 comments:
Post a Comment