Ajax post to apache2/mod_ssl with client certificates

I’m using the text_field_with_auto_complete_helper in one of my forms.
It’s the only input in the form (along with submit button).

I’m deploying with certain parts of site restricted to use https with
client certificates.

Basically whats happening is that the autocomplete dropdown is getting
populated correctly - i select one and it puts it’s value in the
text_area - but when i hit enter again to submit the form I hit a
problem. The value of the text-area is lost from the form submit.

I get the following in my log

NoMethodError (undefined method []' for nil:NilClass): /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/macros/auto_complete.rb:40:in auto_complete_for_order_name’
/usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/macros/auto_complete.rb:38:in
`auto_complete_for_order_name’

Neways - I investigated a little bit.

If i view the form and manually enter in the entire text (like i’d
expect to be returned by the autocomplete) then the paramater isn’t lost

  • and everything works as expected.

If I turn off client certificate checking in apache - then it all works
as expected.

I though it may be a problem specific to one browser - but I got exactly
the same behaviour in both IE and Firefox.

I changed my form so that the Ajax autocompleter uses get instead of
post requests:

new Ajax.Autocompleter(‘order_name’, ‘order_name_auto_complete’,
‘/staff/orders/auto_complete_for_order_name’, {method: ‘get’})

With this change - the autocomplete and subsequent form submit all works
as expected.

It’s an incredibly specific problem - has anyone else come across this?

Or has anyone else come across the problem of file_uploads over https?
http://www.ruby-forum.com/topic/51238#new

Headaches…