[99s-extend] Cowboy + SSL

Loïc Hoguin essen at ninenines.eu
Mon Jan 26 11:29:34 CET 2015


Hey, this is a known issue with recent Erlang versions: 
https://github.com/ninenines/ranch/issues/90

I don't have a good fix for it other than requiring ssl for using 
Cowboy/Ranch. I probably will.

On 01/21/2015 07:28 PM, e at bestmx.net wrote:
> reading the sources i have found that this crash i am trying to report
> is intended behavior,
> but
> it happens in the middle of the SHUTDOWN procedure!
>
>
> I tried to investigate how a relx's release shuts down
> and i have found it is merely one call to: init:stop/0
> nothing else.
>
> the manual says:
>
> stop() -> ok
>
> All applications are taken down smoothly, all code is unloaded, and all
> ports are closed before the system terminates. If the -heart command
> line flag was given, the heart program is terminated before the Erlang
> node terminates.
>
> I end up totally clueless -- everything is rock solid yet it crashes.
> maybe there is some clue in the sequence of shutting down applications?
>
> does anything controls/defines that sequence?
>
>
>
> On 01/19/2015 08:32 PM, e at bestmx.net wrote:
>> Hello.
>>
>> i still have a problem with SSL.
>> as soon as i change cowboy:start_http call to cowboy:start_https
>> my release refuses to stop (when requested)
>> and when i revert to "http" it starts and stops normally.
>>
>> i am sure it is the only difference: start_http vs. start_https
>>
>> i am using relx with default settings as it was provided by cowboy
>> (Erlang R17, System: Debian "testing")
>>
>> here is my_app.erl:
>>
>> start(_Type, _Args) ->
>>    Dispatch =
>>    cowboy_router:compile([{'_', [{"/start", ws_handler, []}]}]),
>>
>>    cowboy:start_https( https, 100, [ {port, 8765}
>>    , {cacertfile, ?Dir ++ "/ssl/cowboy-ca.crt"}
>>    , {certfile, ?Dir ++ "/ssl/server.crt"}
>>    , {keyfile, ?Dir ++ "/ssl/server.key"} ]
>>    , [{env, [{dispatch, Dispatch}]}]),
>>
>>    online37_sup:start_link().
>>
>> stop(_State) -> ok.
>>
>>
>> once i call:
>> release/bin/my_release stop
>>
>> the erlang.log repeats hundreds of:
>>
>> =ERROR REPORT==== 19-Jan-2015::20:06:02 ===
>> Error in process <0.234.0> on node 'online37 at 127.0.0.1' with exit value:
>> {{case_clause,{error,closed}},[{ranch_acceptor,loop,3,[{file,"src/ranch_acceptor.erl"},{line,28}]}]}
>>
>>
>>
>>
>> what could it be?
>> any misconfiguration of my system (regarding ssl support)?
>> what exactly does ranch expect from me?
>>
>>
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> https://lists.ninenines.eu/listinfo/extend
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> https://lists.ninenines.eu/listinfo/extend

-- 
Loïc Hoguin
http://ninenines.eu


More information about the Extend mailing list