refine create_tcp_connection/create_ssl_connection