main2013: Use secure connection if required.