Wednesday, May 27, 2009

Importing mail ssl cert into iPhone

Here is how I got a certificate from our courier imap mail server onto a new 3G iPhone.

If your mail server is using imap and has a self-signed certificate, then you'll need to do something like this, because the iPhone will not trust it otherwise.

This trick was done with on a Linux PC, but it should work on Windows or Mac if you know where to find your Thunderbird and Firefox settings directories. You don't need to have the PC plugged into the iPhone for this to work.

1) Download and install Thunderbird. Set it up to point at the imap mail server.

2) The connection failed in our case since our imap server only accepts SSL. Now click settings for the connection and change it to use SSL. The port number will change to 993.

3) Connect to imap from Thunderbird. It shows a dialog about a certificate - accept a permanent exception.

4) Fire up Thunderbirds certificate manager by clicking on preferences, and advanced, and certificates.

5) Confirm that you have the certificate stored by Thunderbird. Note that Thunderbird has no export facility, but Firefox does. For iPhone we want the certificate in .der format.

6) Close Thunderbird. Close any running instance of Firefox.

7) Save your current Firefox settings directory - on Linux this is the directory .mozilla - do this in a command prompt, in your home/settings directory:
mv .mozilla save-mozilla

8) Run firefox. It will start up in a freshly initialized state because you have moved your settings out of the way. This will cause it to create a fresh, disposable .mozilla data directory that you can do what you like with.

9) Close firefox.

10) Look under your .thunderbird and .mozilla directory for the certificate databases: in my case the files were in a directory .mozilla/xevjor02.default. Thunderbird had a similarly named directory.

11) Copy them from .thunderbird over the top of the ones in your fresh, disposable .mozilla directory (don't use your real one, now saved in save-mozilla) by typing this in a command prompt:
cp ~/.thunderbird/xevjor02.default/*.db .mozilla/firefox/qo6x6lxa.default/.

12) Launch firefox. Run the certificate manager by preferences -> advanced -> certificates.

13) Confirm that the certificate you accepted in thunderbird is now visible in firefox's more full-featured certificate manager.

14) Use the firefox cert managers export feature to save the imap ssl cert as a file "my-server.der" on your desktop. Close firefox. Restore your profile directory, by doing this in command prompt:
mv save-mozilla .mozilla
15) Create an email to an account that you can already read on the iphone, such as your gmail account. Attach the cert to the email and send it.

16) On the iphone, read the email and tap the certificate attached.

17) Accept the install certificate prompts.

18) Reboot the iPhone.

19) The iphone mail program should now connect to the imap ssl server using that certificate.

Win!!

Tuesday, May 12, 2009

Who Killed the Electric Tram


Yesterday I finished reading Edwin Black's book "Internal Combustion: How Corporations and Governments Addicted the World to Oil, and Derailed the Alternatives".

The material in Black's book ought to be a part of the history curriculum of every high-school student in the West, since as we know, those who cannot learn from the lessons of history are doomed to repeat them.

And this is stuff everyone should know.

Doomed is the right word.

Everyone should know how GM was convicted in 1949, along with its co-conspirators Firestone Tire & Rubber, Standard Oil, Pacific City Lines, and National City Lines of a conspiracy to monopolize the transit business for their own oil, tires and buses.

GM was the leader of the conspiracy, setting up the companies National City Lines & Pacific City Lines as a front through which to funnel their acquisitions of electrified transit systems.

The words conspiracy and monopoly have legal meanings here.  While they are emotive for us as members of the public, and have meanings that conjure all sorts of images, remember that these corporations were convicted on charges framed in these very terms.

If you want lurid, you only have to look on in the book to the involvement of gangster Kid Cann, and BM Larrick, of National City Lines in the destruction of the streetcars in Minneapolis and St Paul, where these men and their cronies resorted to shunting cars onto sidings and torching them to speed up the "conversion" process: 

Then that last trolley that had brought so many people so many places for so many years was gleefull ignited by Osanna himself.  The prone, burning streetcar, embodying the long crusade against electric traction, quickly exploded into sky-reaching flames.  Dressed in spats, Ossanna smiled for the cameras as the immolation rose behind him.

In my review of the book I mention that Black's main achievement here is a throroughly researched journalistic survey of a century of corporate malfeasance and dirty dealings around energy and transit.

The take away lesson which we must not forget is that corporations cannot be trusted to do the right thing by the people.

This might seem obvious to many.  But the outgoing President of the USA and many others still in power believe in the free market, and entrepreneurial spirit as the only way forward.

Emissions trading schemes, tax incentives, research grants and a plethora of government handouts have supported this idea that private enterprise will do the right thing given the chance.  See my previous article on the failure of such schemes as a complete solution for this reason.

Reading this book will demonstrate why we are doomed if we believe this, that is if we fail to learn from the lessons of the last century.

A good product will fail in the face of a bad product peddled by monopolists, price-fixers, and corporate raiders.  The idea that a good product at a fair price will win out is flawed when the playing field is not just out of level but precipitously pitched in favour of ratbag corporations, and the categorically ruthless money men that run them.

Clean and sustainable solutions will be forgone for dirty, short term solutions where the true costs are not paid by the profiteers.  As Black points out this has happened over and over again in history.  And it is happening now, even as people die in Katrina style climactic events.

Where I part ways with Black is over his proponency of hydrogen as a solution.  Hydrogen is an interesting research area, however it has never been used as a large scale motive force in transit.

Electricity has.

Electric motors and batteries have been quietly in service in cars, trucks, buses and rail systems throughout the last century.  Black describes in the chapter "Derailed" how the innovative Olympian train hauled over the scenic Milwaukee Road using regenerative braking to economize on electric power.  It did this in the era of World War One.  If it hadn't been for the efforts of various corporate crooks electric transit would have been far more prevalent today.

Whatever your view of electric cars, they are here now, on the road, working as a real solution today.  From the exotic Tesla, through the workaday Th!nk these modern electric marvels are not on a drawing board somewhere, they are proven working vehicles.

Where as for hydrogen:
A 2008 report from the National Research Council estimated it would take $200 million from government and industry over the next 15 years to commercialize hydrogen fuel cell vehicles to the point they could be competitive with gas vehicles.
(Reported by reuters)

The problems of practical transport using hydrogen are well known - see this article in Popular Mechanics for an even handed analysis.

Hydrogen has its hands as dirty as oil, since it is traditionally made from natural gas, a fossil fuel.  Companies mentioned by Black in his chapter on hydrogen, such as Linde, and Air Liquide are now leading members of the National Hydrogen Association, along with guess who: General Motors and Shell.

Hydrogen futurists such as Dr Alan Lloyd were pivotal in killing off the California zero emissions mandate.  The ZEV laws brought in by the California Air Resources Board to fight chronic smog had led to a huge flurry of electric vehicle activity in California.  In the period where Lloyd was the Chairman of the California Air Resources Board and Secretary of the California EPA the electric vehicle innovation and recharge point infrastructure rollout was crushed literally, and replaced with a highly touted hydrogen program.

Lloyd was also Chairman of the California Fuel Cell partnership.  He vehemently denied that this was a conflict of interest.

Of course proponents of hydrogen with vested interests ranging from pet research to major investment, are ready with all sorts of arguments against the view that electric is superior to hydrogen for transport.  Even if they're not all Lloyds with a cash register tune playing in their ears, their views are based on theory.

Electric cars are - I say it again - here now.  Working, on our streets.

But today (the 12th of May 2009) newspapers are reporting the Obama administration's slashing of funding for hydrogen initiatives in favour of battery research and other initiatives.

We know that Obama has had a concerted campaign to throw out from Washington the vested interests, the lobbyists and the revolving door politico-corporate types.  In their place he has filled his administration with scientists and innovators.

The result: electric cars the reality is chosen over a solution that is still on a drawing board 10 years away.