Extend connection handling to support more dynamic endpoint construction; refine missing secret handling