[erlang-questions] Node Crash for inets config 'SocketType ssl'
Prakash Parmar
prakash.parmar@REDACTED
Thu Jul 12 07:19:02 CEST 2018
Hello Ingela,
I tweak rebar3 config to just load inets application rather than starting along with node using relx configuration {inets, load}. From node shell I have started ssl application and then inets application. But still I'm getting same Crash. Do you have any idea what might be wrong with it ?
/Cheers,
Prakash Parmar
________________________________
From: Ingela Andin <ingela.andin@REDACTED>
Sent: Wednesday, July 11, 2018 5:05 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
Hi!
Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started.
Regards Ingela Erlang/OTP team - Ericsson AB
2018-07-11 7:12 GMT+02:00 Prakash Parmar <prakash.parmar@REDACTED<mailto:prakash.parmar@REDACTED>>:
Hello Ingela,
Thanks for your response
I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ?
Let me know if there is any way to make sure to start ssl application before inets application.
/Cheers,
Prakash Parmar
________________________________
From: Ingela Andin <ingela.andin@REDACTED<mailto:ingela.andin@REDACTED>>
Sent: Tuesday, July 10, 2018 9:33:50 PM
To: Prakash Parmar
Cc: Erlang Questions
Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl'
Hi!
Did you start the ssl application?
Regards Ingela Erlang/OTP Team - Ericsson AB
2018-07-10 8:21 GMT+02:00 Prakash Parmar <prakash.parmar@REDACTED<mailto:prakash.parmar@REDACTED>>:
Hello,
I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration
as per the sample configuration located at Erlang's repo [1].
Here are the config file snippet I had changed/added,
...
SocketType ssl
SSLCertificateFile {{install_dir}}/config/www/certs/server.pem
SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem
SSLVerifyClient 0
...
I have also generated certificate files[2] and kept it in above mentioned path.
unfortunately node is crashing at startup and following logs is printed on shell.
=CRASH REPORT==== 9-Jul-2018::12:13:50 ===
crasher:
initial call: application_master:init/4
pid: <0.902.0>
registered_name: []
exception exit: {{shutdown,
{failed_to_start_child,httpd_sup,
{shutdown,
{failed_to_start_child,
{httpd_instance_sup,any,8881,default},
{shutdown,
{failed_to_start_child,
{httpd_acceptor_sup,any,8881,default},
{shutdown,
{failed_to_start_child,
{httpd_acceptor_sup,any,8881,default},
{'EXIT',
{function_clause,
[{http_transport,start,
[ssl],
[{file,"http_transport.erl"},{line,54}]},
{httpd_acceptor,do_socket_start,1,
[{file,"httpd_acceptor.erl"},{line,101}]},
{httpd_acceptor,do_init,4,
[{file,"httpd_acceptor.erl"},{line,94}]},
{httpd_acceptor,acceptor_init,8,
[{file,"httpd_acceptor.erl"},{line,82}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},
{line,247}]}]}}}}}}}}}},
{inets_app,start,[normal,[]]}}
in function application_master:init/4 (application_master.erl, line 134)
ancestors: [<0.901.0>]
messages: [{'EXIT',<0.903.0>,normal}]
links: [<0.901.0>,<0.739.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 987
stack_size: 27
reductions: 166
neighbours:
Does anyone know what might be the problem ?
I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity,
Arity for this function is like {ssl, <Certificate_file_path>}. Any idea on this ? Did I missed anything ?
/ cheers,
Prakash Parmar
Reference,
[1] https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/ssl.conf
https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/httpd.conf
[2] https://devcenter.heroku.com/articles/ssl-certificate-self
https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files
[3] https://github.com/erlang/otp/blob/177a3470d598c892e0b7251cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54
_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED<mailto:erlang-questions@REDACTED>
http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180712/3f9ab346/attachment.htm>
More information about the erlang-questions
mailing list