diff options
author | Ingela Anderton Andin <[email protected]> | 2015-09-15 16:39:42 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-09-15 16:39:42 +0200 |
commit | e802c5d8152440cc59003f04271f7f1934453db4 (patch) | |
tree | b20ade33c7be23c4bc4c034c5ed122f491a9f74b /lib/inets/src | |
parent | 0d2bebf94d99b2d3bd39c5731ac81122f3ea7fb7 (diff) | |
parent | a66d9fb8813d32c7ded2253a7a5904f5b20b5ba8 (diff) | |
download | otp-e802c5d8152440cc59003f04271f7f1934453db4.tar.gz otp-e802c5d8152440cc59003f04271f7f1934453db4.tar.bz2 otp-e802c5d8152440cc59003f04271f7f1934453db4.zip |
Merge branch 'ia/pr/800/OTP-12984' into maint
* ia/pr/800/OTP-12984:
inets: Forward connection errors with https proxy
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index 205348524a..6e6cc38c06 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1817,13 +1817,13 @@ host_header(_, URI) -> tls_upgrade(#state{status = {ssl_tunnel, #request{settings = - #http_options{ssl = {_, TLSOptions} = SocketType}} = Request}, + #http_options{ssl = {_, TLSOptions} = SocketType}, + address = Address} = Request}, session = #session{socket = TCPSocket} = Session0, options = Options} = State) -> case ssl:connect(TCPSocket, TLSOptions) of {ok, TLSSocket} -> - Address = Request#request.address, ClientClose = httpc_request:is_client_closing(Request#request.headers), SessionType = httpc_manager:session_type(Options), Session = Session0#session{ @@ -1844,7 +1844,11 @@ tls_upgrade(#state{status = status = new }, {noreply, activate_request_timeout(NewState)}; - {error, _Reason} -> + {error, Reason} -> + Error = httpc_response:error(Request, {failed_connect, + [{to_address, Address}, + {tls, TLSOptions, Reason}]}), + maybe_send_answer(Request, Error, State), {stop, normal, State#state{request = Request}} end. |