title: Run an escript using TLS distribution
body: <p>I have been unable to make TLS distribution work when providing arguments for the vm via the %! line in the escript.</p>
  
  <pre><code>cat test.es
  #!/usr/bin/env escript
  %%! +P 256000 -env ERL_MAX_ETS_TABLES 256000 -env ERL_CRASH_DUMP /dev/null -env ERL_FULLSWEEP_AFTER 0 -env ERL_MAX_PORTS 65536 +A 64 +K true +W w -smp auto -boot /tmp/start_clean -proto_dist inet_tls -ssl_dist_opt server_certfile "/var/lib/cinched/cert.pem" server_cacertfile "/var/lib/cinched/cacert.pem" client_certfile "/var/lib/cinched/cert.pem" client_cacertfile "/var/lib/cinched/cacert.pem" server_keyfile "/var/lib/cinched/key.pem" client_keyfile "/var/lib/cinched/key.pem" -name test@192.168.101.1
  
  main(_) -&gt;
          io:format("Ping: ~p~n",[net_adm:ping('cinched@192.168.101.1')]).
  
  
  [root@dev1 ~]# ./test.es
  {error_logger,{{2016,1,15},{23,36,42}},"Protocol: ~tp: not supported~n",["inet_tls"]}
  {error_logger,{{2016,1,15},{23,36,42}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,&lt;0.21.0&gt;},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,322}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[net_sup,kernel_sup,&lt;0.10.0&gt;]},{messages,[]},{links,[&lt;0.18.0&gt;]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,211}],[]]}
  {error_logger,{{2016,1,15},{23,36,42}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[['test@192.168.101.1',longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
  {error_logger,{{2016,1,15},{23,36,42}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
  {error_logger,{{2016,1,15},{23,36,42}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4']}},{pid,&lt;0.9.0&gt;},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,133}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}},{ancestors,[&lt;0.8.0&gt;]},{messages,[{'EXIT',&lt;0.10.0&gt;,normal}]},{links,[&lt;0.8.0&gt;,&lt;0.7.0&gt;]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376},{stack_size,27},{reductions,164}],[]]}
  {error_logger,{{2016,1,15},{23,36,42}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]}
  {"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}}"}
  </code></pre>
  
  <p>The boot file it's pointing to doesn't seem to be taken into account. I've tried other variations (trying to start the dependant apps via the -s switch), however nothing seems to work so far.</p>
  
  <p>The boot file:</p>
  
  <pre><code>{release,{"start_clean",[]},
           {erts,"6.4"},
           [{kernel,"3.2"},
            {stdlib,"2.4"},
            {sasl,"2.4.1"},
            {crypto,"3.5"},
            {asn1,"3.0.4"},
            {public_key,"0.23"},
            {ssl,"6.0"}
            ]}.
  </code></pre>