Encode connection authorization key once.

#2952 and the EPIPE fix got rolled back somewhere, and are missing both `next` and `v1.15.x`.