anchor.diff:  %%--------------------------------------------------------------------------
   handle_ctrl_result({tls_upgrade, _}, #state{csock = {tcp, Socket},
   					    tls_options = TLSOptions,
  +					    timeout = Timeout,
   					    caller = open, client = From}
   		   = State0) ->
       ?DBG('<--ctrl ssl:connect(~p, ~p)~n~p~n',[Socket,TLSOptions,State0]),
  -    case ssl:connect(Socket, TLSOptions) of
  +    case ssl:connect(Socket, TLSOptions, Timeout) of
   	{ok, TLSSocket} ->
   	    State = State0#state{csock = {ssl,TLSSocket}},
   	    send_ctrl_message(State, mk_cmd("PBSZ 0", [])),
  
positive.code:     {ok,State}.
  
  
  send_ctrl_message(S=#state{csock = Socket, verbose = Verbose}, Message) ->
      verbose(lists:flatten(Message),Verbose,send),
      ?DBG('<--ctrl ~p ---- ~s~p~n',[Socket,Message,S]),
      send_message(Socket, Message).
  
  send_data_message(S=#state{dsock = Socket}, Message) ->
      ?DBG('<==data ~p ==== ~s~p~n',[Socket,Message,S]),
      case send_message(Socket, Message) of
  	ok ->
  	    ok;
  
negative.code: 	{ok, Socket} when  is_list(TLSOptions) ->
  	    gen_tcp:close(LSock),
  	    ?DBG('<--data ssl:connect(~p, ~p)~n~p~n',[Socket,TLSOptions,State0]),
  	    case ssl:connect(Socket, TLSOptions, DTimeout) of
  		{ok, TLSSocket} ->
  		    {ok, State0#state{dsock={ssl,TLSSocket}}};
  		{error, Reason} ->
  