Wednesday, April 13, 2011

RPC Over HTTP for Outlook on Windows 7 Using a Self Signed Certificate

So yesterday I was faced with a goofy problem with something I have done a million times before. You see, usually I set up Outlook on laptops to use RPC over HTTP so that I don't have to use VPN to get to a corporate Exchange server. The problem is that I had never done it with Windows 7 yet (things are still kind of stuck in XP land over here). Anyway, the exact methods used on Windows XP weren't working on Windows 7. So here's what ended up working:
  1. Find an XP box and visit the OWA website for your organization (I'm assuming you're using one since I believe RPC over HTTP uses it)
  2. Export the X.509 Cert w/ chain (PEM) version of the certificate using these instructions
  3. Save the certificate somewhere (add a .cer extension if needed)
  4. Transfer the .cer file to the Win7 machine and open it
  5. Click Install Certificate...
  6. Click Next >
  7. Select "Place all certificates in the following store"
  8. Click Browse...
  9. Select the "Trusted Root Certification Authorities"
  10. Click OK and finish the process
  11. RPC over HTTP will now connect where it wouldn't before

Tuesday, April 5, 2011

Using a Query String with Segmented Controller/Method URLs in CodeIgniter

CodeIgniter has some awesome segmented URL functionality baked into its core, but sometimes you want to be able to do things like this:

You can do so easily by doing the following:
  1. In config.php change:
    • $config['enable_query_strings'] to TRUE
    • $config['uri_protocol'] to 'PATH_INFO'
  2. In your controller:
    • Fetch the query string using $this->input->get('some');
      (this example corresponds with the above URL)

And that's all folks! It works when a query string isn't present, it works with any number of query string variable pairs, it works with method parameters (e.g. /my_controller/my_method/my_param?some=more). It just works! Sweet, eh?