mirror of
https://github.com/internetee/epp_proxy.git
synced 2025-08-22 07:00: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.
|
||||
request_body(?helloCommand, _, _) -> "";
|
||||
request_body(_Command, RawFrame, nomatch) ->
|
||||
{multipart, [{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]};
|
||||
{multipart,
|
||||
[{<<"raw_frame">>, RawFrame}, {<<"frame">>, RawFrame}]};
|
||||
request_body(_Command, RawFrame, ClTRID) ->
|
||||
{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.
|
||||
%% [{"user", "eis"}]} becomes later https://example.com?user=eis
|
||||
|
|
|
@ -44,15 +44,13 @@ start_link(Socket) ->
|
|||
%% mod_epp does exactly the same thing.
|
||||
handle_cast(serve, State = #state{socket = Socket}) ->
|
||||
{ok, {PeerIp, _PeerPort}} = ssl:peername(Socket),
|
||||
|
||||
case ssl:handshake(Socket) of
|
||||
{ok, SecureSocket} ->
|
||||
NewState = state_from_socket(SecureSocket, State),
|
||||
{noreply, NewState};
|
||||
{error, Error} ->
|
||||
log_on_invalid_handshake(PeerIp, Error)
|
||||
{ok, SecureSocket} ->
|
||||
NewState = state_from_socket(SecureSocket, State),
|
||||
{noreply, NewState};
|
||||
{error, Error} ->
|
||||
log_on_invalid_handshake(PeerIp, Error)
|
||||
end;
|
||||
|
||||
%% Step two: Using the state of the connection, get the hello route
|
||||
%% from http server. Send the response from HTTP server back to EPP
|
||||
%% client. When this succeeds, send "process_command" to self and
|
||||
|
@ -169,7 +167,8 @@ log_on_timeout(State) ->
|
|||
|
||||
log_on_invalid_handshake(Ip, Error) ->
|
||||
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]),
|
||||
exit(normal).
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ error_test_case(Config) ->
|
|||
revoked_cert_test_case(Config) ->
|
||||
Options = proplists:get_value(revoked_options, Config),
|
||||
{error, Error} = ssl:connect("localhost", 1443, Options, 2000),
|
||||
ct:pal("~p", [Error]),
|
||||
{tls_alert,
|
||||
{certificate_revoked,
|
||||
"received CLIENT ALERT: Fatal - Certificate Revoked"}} = Error,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue