There are two different errors (one for each transport) that both looked hard to parse, so I punted.  I'll take a second look and see if I can't clean it up.