# Saturday, 04 August 2012

So there I was writing my first application for Windows 8, I had to call a web service sitting on a server which had to be connected through HTTPS, but because it wasn't a production server the certificate was self signed and thus is considered to be an invalid cert. No biggie I thought, with all my years of .Net experience I knew that all I had to do was fiddle with the System.Net.ServicePointManager.ServerCertificateValidationCallback method, as mentioned here.

Imagine my surprise when I realized that the class doesn't exists when you're writing a .Net app for the Windows Runtime!

Trying to look for other solutions also came up empty, it was then which I realized that what I needed to do was to allow the application to get a certificate which ISN'T invalid. What I needed was a web proxy which could give the impression that the remote certificate was actually valid.

What I needed... was Fiddler!

So first download Fiddler4 (Because Windows 8 comes with .Net 4.0) from the download page.

After installation and running the program enter Fiddler Options by selecting Tools->Fiddler Options from the menu bar.

image

After which head into the HTTPS tab and check Decrypt HTTPS Traffic

image

You'll be warned that you're about to install a wild card certificate on your system. Shown below is one of the many warning screens, you'll have to answer YES to ALL of them.

image

After the certificate is installed, look back at the options window and check Ignore Certificate Errors. This will make Fiddler not complain about any invalid certs.

image

Fiddler is a web proxy, which basically means it sits between your machine and the internet so you can monitor the web traffic your PC is making as long as the program is setup to use the system proxy. If you don't know what this implies then just keep Fiddler on only when you're doing development, and turn it off once you're done.

For more information about using Fiddler to assist in Windows 8 development out this post.


Note that you can Post As GUEST as well.
blog comments powered by Disqus
Comments are closed.