EAS MD – Version 0.9 Beta

Coding my little Exchange ActiveSync utility has been fun, and I’m still tweaking it. However since Visual Studio 2010 just went RTM I got derailed for a few days. I’m not using any fancy new features that would require VS 2010 – that’s true, but it inspired me to undergo an effort to do other things to raise my code quality than just reading over the code lines again. I consider it “sharpening my programming saw” as it’s not directly related to me being a hobby programmer, but nonetheless helps me become better at it.
(https://www.stephencovey.com/7habits/7habits-habit7.php)

I upgraded the project from VS 2008 to VS 2010, which in itself doesn’t change anything. But I decided to implement something I as a lone coder haven’t bothered with doing yet; I needed a system for bug tracking, source control, etc. So I decided to install Team Foundation Server 2010 and learn the basics. I know, it’s probably overkill for my needs, but if it isn’t overkill it’s just no fun :) What this means though is that whenever someone gives me feedback after using the utility, or I find something myself I log into the SharePoint site and enter it for further follow up. I still don’t know where this app will end up, and it might not be worth the effort developing it further, but at least I’m committed to do the development proper. The app itself has helped my in my daily job a couple of times already.

Enough about that – what’s new with this build? I’ve started refactoring parts of the code, and weeded out a couple of bugs in the process (an ongoing process of course). I’m in the process of configuring automated tests so I can be sure I test every combo. And I’ve added client certificate authentication!

Testing your client certificate scenario isn’t always that easy, so using a desktop tool should hopefully be easier to use. The way it works is that you need to type in the complete file path of a .cer file and tick the checkbox, and the certificate will be used for authentication purposes. Mind you – client certificate authentication isn’t exclusively a client side thing. The way it works, or doesn’t work, depends on your servers too. You might have to fill in username and password in addition to the certificate to validate. (The rest of the Exchange config for client certificates really demands an article of it’s own. That I have not written yet. But hopefully will get around to looking into.)

So, that’s all for now. Please update your hard drive with the new version if you are a user of this tool.

Link: http://mobilitydojo.net/files/EAS_MD_0.9b.exe

A Couple of Design Changes to MobilityDojo.net

This isn’t exactly newsworthy, but if you’re a frequent flyer on this site you’ll notice that the design has changed ever so slightly. I upgraded the theme, and re-arranged a couple of page elements. While it’s still very similar to the old design, it feels a little bit fresher to my eyes.

Now, if I just moved around a few labels I probably would not have bothered writing up a post. The main thing that has changed is that I’ve now added a banner ad, and thus many would consider this as cluttering up the design. (I don’t know if there’s someone who considers it selling out in general to use advertising.)

I know the feeling. And it’s an experiment I’m doing. Does it make the site less appealing? Maybe. Do you just mentally block it out and ignore it? Maybe. (I tried to not make it ovecr the top flashy.) Why did I put a GoDaddy ad there specifically? Well, and don’t take this as me putting on my marketing hat; I’m really happy with the SSL certificates they offer. I use them both at home and work – they work on pretty much all devices I test, and they cost a fraction of a VeriSign certificate. Might not be the right choice for everyone, but works for me. So while I agree that it’s still an ad, it is at least a product I can recommend. With Google ads I’d have less control, and would probably need to generate way much more traffic to get any noteworthy amount paid out. (If GoDaddy pays off I do not know either of course.)

I did not start this site to make big money. And I’m making good on that premise so far :) Web hosting doesn’t cost all that much, and there’s no doubt the main investment is the amount of hours I put into it. Not much up-front cost in other words. The other cost is the hardware I use to test/develop and document my articles and utilities on. And I’m the kind of guy who would undoubtedly have a computer or four at my home whether I’m running this site or not :) I could of course make do with even more gadgets and stuff in my lab.

I might perform a few other minor tweaks the next couple of days too, so don’t worry if it looks a little different one day, or there’s a new page or something.

I’ve also contemplated adding a PayPal donation button for those who feel like giving. (Does it make me sound needy? It would be completely optional.) Don’t worry though – I’m not going out of business, and I’m not changing this to a commercial site. If you enjoy my work please continue doing so.

I’m open for input, and feel free to post your thoughts in the comment field or ping me.

This service announcement was brought to you by the benevolent host of MobilityDojo.net :D

Rolling Your Own Exchange ActiveSync Client

I got my hands dirty with ActiveSync two weeks back (http://mobilitydojo.net/2010/03/17/digging-into-the-exchange-activesync-protocol), and shared the results with you here. I also mentioned that doing the things I did required a few lines of code since not everything could be done in Fiddler. Because of this I promised you I had something in the works to let you actually play around too, without cracking open your Visual Studio, and now I’m trying to make good on this promise :)

I introduce to you, the first beta release of “Exchange ActiveSync MD”. It is a desktop app that will let you emulate a device connecting to ActiveSync. Yes, it is similar to what www.testexchangeconnectivity.com, but I only focus on EAS, and I have a couple of options not present in the ActiveSync test MSFT provide. It will require you to have .Net 3.5 installed on your computer – I’ve tested it running on Windows 7 and Windows Server 2008 R2, but it should work on other Windows versions too with .Net present. It will not require an installation, and you can just run the .exe file itself.

It has only three screens to relate to, and while most of it is fairly self-explanatory, (doesn’t always the programmer believe this to be the fact?), I’ll walk you through it:

Main
image

This would be the place you’ll be finding yourself in most of the time using this simple app. There are two tests you can perform; “Basic Connectivity” and “Full Sync”.

Basic Connectivity: for this test you will need to provide the connection parameters, but you can ignore the other options and parameters. This test will perform a HTTP GET against the specified server address to pinpoint basic issues like DNS resolution, server being reachable, and authentication. If the GET works you’ll get a 501/505 the same way as opening the address in a browser. If the GET goes through a HTTP OPTIONS is done against the server to pull down info like server version, etc.

Full Sync:
You still need to fill out the connection parameters, but there are default values provided for the other options. (The connection will be made at the Exchange 2007 RTM level if nothing else is specified in MS-ASProtocolVersion.) The program will attempt the FolderSync command, and provide response based on the security polices in effect on the server. You will be informed in the output window if the sync didn’t go through for some reason, and a tip for correcting it.
For Device ID, Device Type & User Agent you can specify whatever you like as long as you’re not using the new features in Exchange 2010 for restricting these parameters.
The “Device Properties” are additional attributes you might need to set for the sync to go through.
The output window has switches for binary, hex, and base64. Most likely you’re not going to need them all that often. (This only applies to the response body, other text and headers are in plain old text format.) I had to use it for some debugging purposes since the wbxml isn’t all that easy to read.

Certificate Info
image

While you can ignore any certificates issues on the previous tab it can be very handy to pull down the chain and see why it fails if you weren’t expecting it to fail. You don’t need to provide any credentials – just point it to a server running SSL (on port 443). The app then establishes a socket connection and pulls down the chain. Some basic info is printed out, and at the bottom the certificates themselves are embedded in base64. This means that you can open up your Notepad, paste in the string, and save the file with the extension .cer and you will have a certificate file you can use. I am aware I could have provided a possibility for provisioning it directly into a certificate store, but that felt like more work than it was worth :) I could also have pulled all the certs into a single p7b format, but.. well, it works the way it should and serves my purposes in it’s present form. Let me know if there is something that is missing from this tab in the feature department.

Base64 Utility
image

I often find my self needing to convert between a base64 string and plain text when testing, so I just included a tab for it in this app. You might not need it that often, but it’s convenient to have easily accessible.

So does it actually work then? I’ve tested against Exchange 2007 SP1/SP2, and Exchange 2010. No Exchange 2007 RTM unfortunately (even if it’s a choice on the list), and Exchange 2003 is not on the supported list yet. (Of course you can test all client versions against the latest server version since Exchange is backwards compatible.) I believe I have tested the different combos of enforcing policies and blocking non-provisionable but there are differences between each AS-version so I cannot guarantee at this time that there’s not some sneaky bug somewhere. (It is a beta for a reason you know.)

I’m also aware that the interface looks kinda “not done by an actual designer”, and while I do like creating 3D graphics and related stuff I never was top-notch at creating user interfaces :)

There are two known issues I haven’t solved at the present time: 
- If you turn on “Trust all certificates”, and then uncheck it you’ll still be trusting all certificates. Workaround is to close the program, and re-start.
- If you have a username and/or password with special characters it might not encode properly, and thus you’ll get a 401 returned.

I am aware of these issues, and will try fixing them. The issues I am not aware will be fixed later on.

While not a bug as such, the internals doesn’t exactly conform to what could be considered “beautiful code”, but that might not be the most important thing at the moment I guess :) (Obviously in the process of cleaning the code, maybe I come across a line that need to be fixed up to so it serves a purpose too.)

My first focus is to do some additional testing, and making sure everything works as advertised. The second priority, which is more fun obviously, is adding new features. How many features could you cram into a small utility like this you say?  Technically you can implement a fully featured ActiveSync client, and while I’m not going to do that the next weeks I am investigating if I can implement wbxml parsing. No promises yet though.

In the meantime, test it out, see if it’s useful, and let me know if you have any questions or feedback.

Download: http://mobilitydojo.net/downloads/ (Sends you to the download page so you can fetch the latest release.)

RSS for Posts RSS for Comments