mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-22 15:20:47 +02:00
Reformat code
This commit is contained in:
parent
8afbf22540
commit
0231aae270
3 changed files with 11 additions and 11 deletions
|
@ -82,10 +82,12 @@ request_from_map(#{command := Command,
|
||||||
%% Return form data or an empty list.
|
%% Return form data or an empty list.
|
||||||
request_body(?helloCommand, _, _) -> "";
|
request_body(?helloCommand, _, _) -> "";
|
||||||
request_body(_Command, RawFrame, nomatch) ->
|
request_body(_Command, RawFrame, nomatch) ->
|
||||||
{multipart, [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]};
|
{multipart,
|
||||||
|
[{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]};
|
||||||
request_body(_Command, RawFrame, ClTRID) ->
|
request_body(_Command, RawFrame, ClTRID) ->
|
||||||
{multipart,
|
{multipart,
|
||||||
[{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}, {<<"clTRID">>, ClTRID}]}.
|
[{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame},
|
||||||
|
{<<"clTRID">>, ClTRID}]}.
|
||||||
|
|
||||||
%% Return a list of properties that each represent a query part in a query string.
|
%% Return a list of properties that each represent a query part in a query string.
|
||||||
%% [{"user", "eis"}]} becomes later https://example.com?user=eis
|
%% [{"user", "eis"}]} becomes later https://example.com?user=eis
|
||||||
|
|
|
@ -44,15 +44,13 @@ start_link(Socket) ->
|
||||||
%% mod_epp does exactly the same thing.
|
%% mod_epp does exactly the same thing.
|
||||||
handle_cast(serve, State = #state{socket = Socket}) ->
|
handle_cast(serve, State = #state{socket = Socket}) ->
|
||||||
{ok, {PeerIp, _PeerPort}} = ssl:peername(Socket),
|
{ok, {PeerIp, _PeerPort}} = ssl:peername(Socket),
|
||||||
|
|
||||||
case ssl:handshake(Socket) of
|
case ssl:handshake(Socket) of
|
||||||
{ok, SecureSocket} ->
|
{ok, SecureSocket} ->
|
||||||
NewState = state_from_socket(SecureSocket, State),
|
NewState = state_from_socket(SecureSocket, State),
|
||||||
{noreply, NewState};
|
{noreply, NewState};
|
||||||
{error, Error} ->
|
{error, Error} ->
|
||||||
log_on_invalid_handshake(PeerIp, Error)
|
log_on_invalid_handshake(PeerIp, Error)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
%% Step two: Using the state of the connection, get the hello route
|
%% Step two: Using the state of the connection, get the hello route
|
||||||
%% from http server. Send the response from HTTP server back to EPP
|
%% from http server. Send the response from HTTP server back to EPP
|
||||||
%% client. When this succeeds, send "process_command" to self and
|
%% client. When this succeeds, send "process_command" to self and
|
||||||
|
@ -169,7 +167,8 @@ log_on_timeout(State) ->
|
||||||
|
|
||||||
log_on_invalid_handshake(Ip, Error) ->
|
log_on_invalid_handshake(Ip, Error) ->
|
||||||
ReadableIp = epp_util:readable_ip(Ip),
|
ReadableIp = epp_util:readable_ip(Ip),
|
||||||
lager:info("Failed SSL handshake. IP: ~s, Error: [~p]~n",
|
lager:info("Failed SSL handshake. IP: ~s, Error: "
|
||||||
|
"[~p]~n",
|
||||||
[ReadableIp, Error]),
|
[ReadableIp, Error]),
|
||||||
exit(normal).
|
exit(normal).
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,6 @@ error_test_case(Config) ->
|
||||||
revoked_cert_test_case(Config) ->
|
revoked_cert_test_case(Config) ->
|
||||||
Options = proplists:get_value(revoked_options, Config),
|
Options = proplists:get_value(revoked_options, Config),
|
||||||
{error, Error} = ssl:connect("localhost", 1443, Options, 2000),
|
{error, Error} = ssl:connect("localhost", 1443, Options, 2000),
|
||||||
ct:pal("~p", [Error]),
|
|
||||||
{tls_alert,
|
{tls_alert,
|
||||||
{certificate_revoked,
|
{certificate_revoked,
|
||||||
"received CLIENT ALERT: Fatal - Certificate Revoked"}} = Error,
|
"received CLIENT ALERT: Fatal - Certificate Revoked"}} = Error,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue