[99s-extend] Cowboy HTTPS Issue

Loïc Hoguin essen at ninenines.eu
Thu Jul 25 11:25:02 CEST 2013


Cowboy requires crypto to start.

On 07/25/2013 11:24 AM, Grzegorz Junka wrote:
> Maybe the problem is with Erlang not seeing the crypto libraries? You
> can verify that quickly by executing "crypto:start()." in the Erlang
> shell. See this post for info:
>
> http://stackoverflow.com/questions/4742184/rebar-error-exit-on-create-app-crypto-start/14776521#14776521
>
>
> Greg
>
> On 23/07/2013 15:01, Lee Sylvester wrote:
>> Okay, thanks Loïc.  I'll try my luck there :-)
>>
>> Regards,
>> Lee
>>
>>
>>
>> On 23 Jul 2013, at 15:00, Loïc Hoguin <essen at ninenines.eu> wrote:
>>
>>> No idea. You'll probably have more luck asking erlang-questions for
>>> SSL issues.
>>>
>>> On 07/23/2013 03:59 PM, Lee Sylvester wrote:
>>>> Thank you, Loic.  I'd forgotten to update my releases folder.
>>>>
>>>> I now have it running, but when I access an endpoint, I get
>>>>
>>>> =ERROR REPORT==== 23-Jul-2013::09:56:29 ===
>>>> SSL: 1159:
>>>> error:[<<48,130,6,220,48,130,5,196,160,3,2,1,2,2,16,15,199,72,40,33,
>>>>                      126,49,13,  [snip]  45,193>>,
>>>>                    <<48,130,6  [snip]  118,247,97>>]
>>>> /usr/certs/cert.pem
>>>>    [{ssl_connection,init_certificates,8,
>>>>                     [{file,"ssl_connection.erl"},{line,1155}]},
>>>>
>>>> {ssl_connection,ssl_init,2,[{file,"ssl_connection.erl"},{line,1110}]},
>>>>     {ssl_connection,init,1,[{file,"ssl_connection.erl"},{line,303}]},
>>>>     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]
>>>>
>>>> Not a very helpful error.  I'm assuming the cert isn't being
>>>> accepted by the SSL module?
>>>>
>>>> Thanks,
>>>> Lee
>>>>
>>>>
>>>>
>>>> On 23 Jul 2013, at 14:41, Loïc Hoguin <essen at ninenines.eu> wrote:
>>>>
>>>>> You need to include and start the public_key and ssl applications.
>>>>>
>>>>> On 07/23/2013 03:12 PM, Lee Sylvester wrote:
>>>>>> Hi guys,
>>>>>>
>>>>>> So, I'm trying to run Cowboy with SSL, but keep getting an error
>>>>>> with the SSL module:
>>>>>>
>>>>>> application: ssl
>>>>>>      exited: {bad_return,
>>>>>>                  {{ssl_app,start,[normal,[]]},
>>>>>>                   {'EXIT',
>>>>>>                       {undef,
>>>>>>                           [{ssl_app,start,[normal,[]],[]},
>>>>>>                            {application_master,start_it_old,4,
>>>>>>                                [{file,"application_master.erl"},
>>>>>>                                 {line,274}]}]}}}}
>>>>>>      type: temporary
>>>>>>
>>>>>>
>>>>>> The way I'm starting Cowboy is like this:
>>>>>>
>>>>>>     Env = [
>>>>>>         {env, [{dispatch, Dispatch}]},
>>>>>>         {onrequest, fun http_utils:set_request_cors/1}
>>>>>>     ],
>>>>>>
>>>>>>     case http_server:is_secure() of
>>>>>>         true ->
>>>>>>             cowboy:start_https(https, 100, [
>>>>>>                 {ip, Ip}, {port, Port},
>>>>>>                 {certfile,
>>>>>> binary_to_list(http_server:secure_cert())},
>>>>>>                 {keyfile, binary_to_list(http_server:secure_key())},
>>>>>>                 {reuseaddr, true},
>>>>>>                 {fail_if_no_peer_cert, true}
>>>>>>             ], Env);
>>>>>>         _ ->
>>>>>>             {ok, _} = cowboy:start_http(http, 100, Options, Env)
>>>>>>     end,
>>>>>>
>>>>>> Does anyone know why I might be getting this issue?
>>>>>>
>>>>>> Thanks,
>>>>>> Lee
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Extend mailing list
>>>>>> Extend at lists.ninenines.eu
>>>>>> http://lists.ninenines.eu:81/listinfo/extend
>>>>>>
>>>>>
>>>>> --
>>>>> Loïc Hoguin
>>>>> Erlang Cowboy
>>>>> Nine Nines
>>>>> http://ninenines.eu
>>>
>>> --
>>> Loïc Hoguin
>>> Erlang Cowboy
>>> Nine Nines
>>> http://ninenines.eu
>> _______________________________________________
>> Extend mailing list
>> Extend at lists.ninenines.eu
>> http://lists.ninenines.eu:81/listinfo/extend
>>
>
> _______________________________________________
> Extend mailing list
> Extend at lists.ninenines.eu
> http://lists.ninenines.eu:81/listinfo/extend


-- 
Loïc Hoguin
Erlang Cowboy
Nine Nines
http://ninenines.eu



More information about the Extend mailing list