Windows 8 Mail and Exchange using a self-signed certificate

Friday, 17 August 2012

The following steps allowed me to get the Windows 8 Mail app to talk to an Exchange server which uses a self-signed certificate:

  1. Open up Internet Explorer in 'Administrator' mode
    1. Go to the Windows 8 desktop
    2. Right-click on the Internet Explorer icon
    3. Highlight 'Internet Explorer'
    4. press Shift-Ctrl-Enter to launch IE in 'Administrator' (elevated permission) mode
  2. Browse to the Exchange server's Outlook Web Access page – eg. https://yourexchangeserver.com/owa
  3. Ignore any warning about certificates – click on 'Continue to this website'
  4. Click on the red certificate warning in the address bar
    certificate error
  5. Click on 'View certificates'
    Untrusted certificate
  6. Click on 'Install certificate' button
  7. The 'Certificate Import Wizard' appears
  8. Leave 'Store Location' as current user
  9. Select 'Place all certificates in the following store', and click on the 'Browse' button to select 'Trusted Root Certification Authorities'
    Certificate import wizard
  10. Complete wizard
  11. Click on 'Yes' to install certificate
  12. Close IE and reopen (in non-admin mode) to confirm when browsing to the OWA URL that you no longer are warned about an invalid certificate

You should now be able to use the 'Add an account' to add your Exchange account.

My next Windows Phone(s)

Friday, 3 August 2012

It's been an interesting journey since I purchased my first Windows Phone. The Samsung Omnia 7 had a brilliant screen and was a joy to use. It would occasionally spontaneously restart, but I put that down to firmware/OS bugs that would be fixed in subsequent updates. Many updates later however, the problem actually got worse rather than better.

While it was away on the last of a number of visits to the service centre, I purchased a second hand (but excellent condition) HTC Mozart. A very capable phone, it was a good replacement.

Samsung finally agreed to a replacement (only after I filmed my handset rebooting – somehow they'd never managed to reproduce the problem themselves) – but by this time the Omnia 7 was no longer in stock, so I was given an Omnia W instead.

The Omnia W didn't seem quite as 'solid' as the 7 – probably the plastic case vs the 7's metal, but it worked well (and didn't spontaneously reboot like it's predecessor).

Nokia Lumia 800

I would have stuck with the Omnia W but for the fact that I was one of the winners of a new Nokia Lumia 800 for entering my Asthma First Aid app in the Windows Phone Apps Download Challenge.

The Mozart and Omnia W have now found new homes with friends and family, and I'm enjoying my nice blue Lumia.

Feature Toggle libraries for .NET

Monday, 9 July 2012

The idea of “Feature Toggles” is described in detail by Martin Fowler. Essentially these give you the ability to enable/disable parts of your application via configuration.

<appSettings>
    <add key="Feature.Toggle1" value="True"/>
</appSettings>

And then within your code, check the config value to enable the feature:

if (bool.Parse(ConfigurationManager.AppSettings["Feature.Toggle1"]))
{

}

Ideally you’d make that check a bit more robust, but you get the idea!

Alternatively, you might want to use one of these libraries that implement feature toggling. I searched for .NET feature toggle libraries and found these four. Coincidentally they are all hosted on GitHub, and all but nToggle are available as NuGet packages.

NFeature

https://github.com/benaston/NFeature

NFeature requires you to create an enum which defines all the feature toggles. It then generates extension methods such that you can check the config setting for a feature. Features are configured through a custom section in the .config file. Features can optionally be configured to depend on other features, and to have availability times set.

<configSections>
    <section name="features" type="NFeature.Configuration.FeatureConfigurationSection`1[[NFeatureTest2.Feature, NFeatureTest2]], NFeature.Configuration" />
</configSections>

<features>
    <add name="MyFeature" state="Enabled" />
    <add name="MyOtherFeature" state="Previewable" />
    <!-- will only be available to users who meet the feature-preview criteria -->
    <add name="MyOtherOtherFeature" state="Disabled" />
</features>
public enum Feature
{
    MyFeature,
    MyOtherFeature,
    MyOtherOtherFeature,
}

...

if ( Feature.MyFeature.IsAvailable( featureManifest ) )
{
    //do some cool stuff
}

NFeature appears to be actively maintained with recent commits.

FeatureToggle

https://github.com/jason-roberts/FeatureToggle

FeatureToggle provides base classes from which you inherit for each feature toggle you want to implement. These toggles are configured in the <appSettings/> section in the .config file.

<appSettings>
   <add key="FeatureToggle.MyAwesomeFeature" value="false" />
</appSettings>
public class MyAwesomeFeature : SimpleFeatureToggle {}

...

if (!MyAwesomeFeature.FeatureEnabled)  
{
   // code to disable stuff (e.g. UI buttons, etc)
}

FeatureToggle also has support for WPF and Windows Phone apps.

It is actively maintained with recent commits.

FeatureSwitcher

https://github.com/mexx/FeatureSwitcher

In FeatureSwitcher, toggles are created by implementing the IFeature interface. You then use the Feature<> generic class to test whether a particular toggle is enabled.

Toggles are configured in the .config file via custom sections.

<configSections>
  <sectionGroup name="featureSwitcher" type="FeatureSwitcher.Configuration.SectionGroup, FeatureSwitcher.Configuration">
    <section name="default" type="FeatureSwitcher.Configuration.DefaultSection, FeatureSwitcher.Configuration"/>
    <section name="features" type="FeatureSwitcher.Configuration.FeaturesSection, FeatureSwitcher.Configuration"/>
  </sectionGroup>
</configSections>
<featureSwitcher>
  <default featuresEnabled="true"/>
  <features>
    <feature name="FeatureSwitcher.Examples.BlueBackground" enabled="true"/>
  </features>
</featureSwitcher>
class BlueBackground : IFeature {}

...

if (Feature<Sample>.Is().Enabled)
{

}

FeatureSwitcher is actively maintained with recent commits.

nToggle

https://github.com/SteveMoyer/nToggle

nToggle uses a custom section in the .config file. The examples given show usage with a WebForms app, though it should work with all kinds of applications.

<configSections>
  <section
    name="nToggle"
    type="nToggle.Configuration.ToggleConfigurationSection"
    allowLocation="true"
    allowDefinition="Everywhere"
    />
</configSections>

<nToggle>
  <toggles>
    <add name="TestFeatureOn" value="True"/>
    <add name="TestFeatureOff" value="False"/>
  </toggles>
</nToggle>
<%@ Register assembly="nToggle" namespace="nToggle" tagprefix="nToggle" %>
<nToggle:WebFeatureToggle ID="FeatureToggle1" EnabledBy="TestFeatureOff" runat="server" >
    <span id="enabledby"> Feature Turned Off</span>
</nToggle:WebFeatureToggle>
protected void Page_Load(object sender, EventArgs e)
{
    WebFeatureToggle1.RunActionWhenEnabled(CodeToRunIfEnabled);
}

protected void CodeToRunIfEnabled()
{
    //your code
}

nToggle has not been updated for 7 months at time of writing.

Improving my home wireless network

Friday, 8 June 2012

I noticed my wireless connection was a bit slow this morning, so after restarting the router (standard "IT Crowd – Have you tried turning it off and on again" approach), I thought it would be worth seeing what other wireless networks were nearby and whether they might be causing some contention for bandwidth.

Years ago I used NetStumbler to do this kind of thing, but it hasn't been updated in a long time and doesn't work with the wireless card on my laptop. Instead I found inSSIDer. It does the job nicely - this is what it revealed:

wireless channels before

My network is the orange one named 'Gardiner'. I've obscured some of the labels to protect privacy.

After switching my router's wireless settings to channel 5, it now looks like this:

wireless channels after

That looks better.

Other options for improving my wireless performance would be upgrading the router to something that support 802.11n (my trusty old Billion only handles 11b + 11g), and maybe getting a wireless repeater to improve coverage around the house.

White men can't?

Sunday, 27 May 2012




Posted by Picasa

It is very important to test out new play equipment before letting the kids have a go :-)