Crash with using HTTPS

87 views
Skip to first unread message

Barco

unread,
May 17, 2012, 4:36:30 AM5/17/12
to zotoni...@googlegroups.com
Hi All,

When I request a https request from browser I got the following crash report. Please help! Thank you!

16:20:59.355 [error] CRASH REPORT Process <0.517.0> with 0 neighbours crashed with reason: {ekeyfile,[{gen_fsm,init_it,6,[{file,"gen_fsm.erl"},{line,371}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
16:20:59.356 [error] Supervisor ssl_connection_sup had child undefined started with {ssl_connection,start_link,undefined} at <0.517.0> exit with reason ekeyfile in context child_terminated
16:20:59.356 [error] application: mochiweb, "Accept failed error", "{error,ekeyfile}"
16:20:59.357 [error] CRASH REPORT Process <0.281.0> with 0 neighbours crashed with reason: {error,accept_failed}
16:20:59.357 [error] {mochiweb_socket_server,317,{acceptor_error,{error,accept_failed}}}
16:20:59.359 [error] SSL: 1130: error:{error,
                     {asn1,
                         {{badmatch,{error,{asn1,{wrong_tag,{131089,16}}}}},
                          [{'PKCS-FRAME',dec_PrivateKeyInfo,2,
                               [{file,"PKCS-FRAME.erl"},{line,1660}]},
                           {'PKCS-FRAME',decode,2,
                               [{file,"PKCS-FRAME.erl"},{line,94}]},
                           {public_key,der_decode,2,
                               [{file,"public_key.erl"},{line,157}]},
                           {ssl_connection,init_private_key,5,
                               [{file,"ssl_connection.erl"},{line,1127}]},
                           {ssl_connection,ssl_init,2,
                               [{file,"ssl_connection.erl"},{line,1064}]},
                           {ssl_connection,init,1,
                               [{file,"ssl_connection.erl"},{line,316}]},
                           {gen_fsm,init_it,6,
                               [{file,"gen_fsm.erl"},{line,361}]},
                           {proc_lib,init_p_do_apply,3,
                               [{file,"proc_lib.erl"},{line,227}]}]}}} priv/ssl/server.key
  [{public_key,der_decode,2,[{file,"public_key.erl"},{line,161}]},
   {ssl_connection,init_private_key,5,
                   [{file,"ssl_connection.erl"},{line,1127}]},
   {ssl_connection,ssl_init,2,[{file,"ssl_connection.erl"},{line,1064}]},
   {ssl_connection,init,1,[{file,"ssl_connection.erl"},{line,316}]},
   {gen_fsm,init_it,6,[{file,"gen_fsm.erl"},{line,361}]},
   {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]

Arjan Scherpenisse

unread,
May 18, 2012, 2:57:52 AM5/18/12
to zotoni...@googlegroups.com
Hi Barco,

check this post about the 'ekeyfile' error:

http://erlang.org/pipermail/erlang-bugs/2012-March/002793.html

Might help you.

Arjan

Barco

unread,
May 18, 2012, 3:23:51 AM5/18/12
to zotoni...@googlegroups.com
Hi Arjan,

Thank you.

But I didn't find the solution there. That mail talked about two key, but I have only one key "server.key" with one certificate file "server.crt".

Could you please illustrate me how to generate these key files and config Zotonic correctly?

thank you

Barco

Arjan Scherpenisse

unread,
May 18, 2012, 3:30:40 AM5/18/12
to zotoni...@googlegroups.com
It might be that either of those files (I guess the .key one) *contains*
two keys instead of one...
Just look inside the file, it's just ascii. Cut one of the two out,
save, see if it works, if not, try the other one?

Ajan

Barco You

unread,
May 18, 2012, 4:12:11 AM5/18/12
to zotoni...@googlegroups.com
this is my key file, but I can not find where is another key?

-----BEGIN ENCRYPTED PRIVATE KEY-----
MIICxjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAB5zHFwvV38CAggA
MBQGCCqGSIb3DQMHBAh7LZbByC+o8gSCAoApZiPVV6GyW3F875MrsRLQxincxSx9
BcMTiQBHHjJMZ5Iv9cMdCR7mrdmqxqfGmbm7eJN6W5AvKHJ7vX6VEcvzfDMtAhFB
qmji/QMgsoIhL+tEgqLgwLIxucIVi/gDs8AwLZNaNZhBjL5V/1RyClWSu3kbXBKd
EiYrqzprLxmsbGvdXVLLNW+ZCFKsbq4BfMW3kXzB7ER6WSpNldEklpClMN2+OX8l
T9zCn1/Pgj7660pUS8nDnRm3BMl5KepsV5SyHWfH6wXxgQGI9sWn1uzxNCizfv8G
OmotzXy6i37+TQ+OpzJ7VrieBdxX0xAvwbpowkLGTR1JhR385AyYPi8d2xCFofKJ
0cK7Zk0AhM8lQoh2YU9wsnNpo92A6R2116s96h5VANuXH9I1uLRoez6L4J8vTNB/
V3hQ5ZGoVnT2tK6QzFtt9aoEV0RMOf/0d3Z6DXfWbgzmO4aFdeu689Sis3qCYATU
tmuH6iykFM6G7LHDwhxhmjel78Pu2yb6g9KdngYRObqtseJd4ZvYyFLfkukSGqV+
annUhlavXDmNM5JFEVXRe0xEIWlX+ZMe2udOnDHSWhs5lRyD0HEd6myn9xT+F++S
NtBGkujM2K478pAowo0yvGyURtxuqETRYIZ6hPCEzkDu4ram39opSvmhwubRmKcF
9LiVz1d5h6rIJLXQKyGzZ5IAT6YSwDB5OUzFKbmxgEeKTj4BahZubXuyIRNGDl9Z
ZiUW+aHZLH8qGiwPVwjH0rILWKZMD/zQAb7lPH0GxFvIQs9ph7hMF5r3IxkM+K+i
9lyhPPUtRXtz/RtfcdiqZb+njEXVwpQCTT1aScOx/+AebzVHlePHTQ5j
-----END ENCRYPTED PRIVATE KEY-----
--
------------------
Best regards,
Barco

Arjan Scherpenisse

unread,
May 18, 2012, 4:20:12 AM5/18/12
to zotoni...@googlegroups.com
This looks alright. So it might be a different issue...

It was not very wise (ahem) to post a private key to a public mailing
list......!!

Arjan


On 05/18/2012 10:12 AM, Barco You wrote:
> this is my key file, but I can not find where is another key?
>
> -----BEGIN ENCRYPTED PRIVATE KEY-----
x

Barco You

unread,
May 18, 2012, 4:36:52 AM5/18/12
to zotoni...@googlegroups.com
So, could you please give a suggestion to solve this problem? I suspect maybe because my Key file has password (when I create the key file with  openssl, it prompts me to input a pem pass phrase). But in the config file of Zotonic there is nowhere to provide this password info. How do you think?

thank you!

Arjan Scherpenisse

unread,
May 18, 2012, 6:23:02 AM5/18/12
to zotoni...@googlegroups.com
That might be the case. What happens if you create a key without a
password, does the error stil occur?

On 05/18/2012 10:36 AM, Barco You wrote:
> So, could you please give a suggestion to solve this problem? I suspect
> maybe because my Key file has password (when I create the key file with
> openssl, it prompts me to input a pem pass phrase). But in the config
> file of Zotonic there is nowhere to provide this password info. How do
> you think?
>
> thank you!
>
> On Fri, May 18, 2012 at 4:20 PM, Arjan Scherpenisse
> <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>> wrote:
>
> This looks alright. So it might be a different issue...
>
> It was not very wise (ahem) to post a private key to a public mailing
> list......!!
>
> Arjan
>
>
> On 05/18/2012 10:12 AM, Barco You wrote:
> > this is my key file, but I can not find where is another key?
> >
> > -----BEGIN ENCRYPTED PRIVATE KEY-----
> x
> > -----END ENCRYPTED PRIVATE KEY-----
> >
> >
> > On Fri, May 18, 2012 at 3:30 PM, Arjan Scherpenisse
> > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>

Barco You

unread,
May 18, 2012, 7:12:54 AM5/18/12
to zotoni...@googlegroups.com
Yes, what I suspect is correct!

I add another parameter in the config file as {ssl_password, "xxxxx"}, and add one this to ssl_opts in file zotonic_sup.erl.

It works now!

thank you!

Arjan Scherpenisse

unread,
May 18, 2012, 8:21:04 AM5/18/12
to zotoni...@googlegroups.com
Cool! Patches welcome :-)

On 05/18/2012 01:12 PM, Barco You wrote:
> Yes, what I suspect is correct!
>
> I add another parameter in the config file as {ssl_password, "xxxxx"},
> and add one this to ssl_opts in file zotonic_sup.erl.
>
> It works now!
>
> thank you!
>
> On Fri, May 18, 2012 at 6:23 PM, Arjan Scherpenisse
> <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>> wrote:
>
> That might be the case. What happens if you create a key without a
> password, does the error stil occur?
>
> On 05/18/2012 10:36 AM, Barco You wrote:
> > So, could you please give a suggestion to solve this problem? I
> suspect
> > maybe because my Key file has password (when I create the key file
> with
> > openssl, it prompts me to input a pem pass phrase). But in the config
> > file of Zotonic there is nowhere to provide this password info. How do
> > you think?
> >
> > thank you!
> >
> > On Fri, May 18, 2012 at 4:20 PM, Arjan Scherpenisse
> > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>

Barco You

unread,
May 18, 2012, 8:24:58 AM5/18/12
to zotoni...@googlegroups.com
Yes, I will. How can I patch it on Github? need to grant me access privilege?

Andreas Stenius

unread,
May 18, 2012, 8:29:54 AM5/18/12
to zotoni...@googlegroups.com
Create a github account (if you don't already have one), then press the "fork" button from https://github.com/zotonic/zootnic

You then have your own clone where you can commit your changes, and the press "pull request" from there to send a request to us that we can review, and apply.

There's plenty of docs both on github and google for this if you are comfortable with search engines ;)
Otherwise, ask for clarification and we can give more elaborate answers...

Cheers,
Andreas

2012/5/18 Barco You <barc...@bestv-intl.com>

Arjan Scherpenisse

unread,
May 18, 2012, 8:33:42 AM5/18/12
to zotoni...@googlegroups.com
No, basically you clone zotonic/zotonic on github your own account, say
barco/zotonic

then you clone barco/zotonic onto your own computer, make changes, push
to your own repo, and then create a pull request on github.

More info here:
http://help.github.com/send-pull-requests/

Arjan


On 05/18/2012 02:24 PM, Barco You wrote:
> Yes, I will. How can I patch it on Github? need to grant me access
> privilege?
>
> On Fri, May 18, 2012 at 8:21 PM, Arjan Scherpenisse
> <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>> wrote:
>
> Cool! Patches welcome :-)
>
> On 05/18/2012 01:12 PM, Barco You wrote:
> > Yes, what I suspect is correct!
> >
> > I add another parameter in the config file as {ssl_password, "xxxxx"},
> > and add one this to ssl_opts in file zotonic_sup.erl.
> >
> > It works now!
> >
> > thank you!
> >
> > On Fri, May 18, 2012 at 6:23 PM, Arjan Scherpenisse
> > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>> wrote:
> >
> > That might be the case. What happens if you create a key without a
> > password, does the error stil occur?
> >
> > On 05/18/2012 10:36 AM, Barco You wrote:
> > > So, could you please give a suggestion to solve this problem? I
> > suspect
> > > maybe because my Key file has password (when I create the
> key file
> > with
> > > openssl, it prompts me to input a pem pass phrase). But in
> the config
> > > file of Zotonic there is nowhere to provide this password
> info. How do
> > > you think?
> > >
> > > thank you!
> > >
> > > On Fri, May 18, 2012 at 4:20 PM, Arjan Scherpenisse
> > > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>

Barco You

unread,
May 18, 2012, 8:38:07 AM5/18/12
to zotoni...@googlegroups.com
I'm doing!  Please wait for notifications!

Arjan Scherpenisse

unread,
May 18, 2012, 10:03:18 AM5/18/12
to zotoni...@googlegroups.com
Merged it, thanks :-D

I had to fix it up a bit. Next time, please make a single commit (not 1
per file like you did now) and respect the whitespace in the .erl files,
please :-)

Arjan

On 05/18/2012 02:38 PM, Barco You wrote:
> I'm doing! Please wait for notifications!
>
> On Fri, May 18, 2012 at 8:33 PM, Arjan Scherpenisse
> <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>> wrote:
>
> No, basically you clone zotonic/zotonic on github your own account, say
> barco/zotonic
>
> then you clone barco/zotonic onto your own computer, make changes, push
> to your own repo, and then create a pull request on github.
>
> More info here:
> http://help.github.com/send-pull-requests/
>
> Arjan
>
>
> On 05/18/2012 02:24 PM, Barco You wrote:
> > Yes, I will. How can I patch it on Github? need to grant me access
> > privilege?
> >
> > On Fri, May 18, 2012 at 8:21 PM, Arjan Scherpenisse
> > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>> wrote:
> >
> > Cool! Patches welcome :-)
> >
> > On 05/18/2012 01:12 PM, Barco You wrote:
> > > Yes, what I suspect is correct!
> > >
> > > I add another parameter in the config file as {ssl_password,
> "xxxxx"},
> > > and add one this to ssl_opts in file zotonic_sup.erl.
> > >
> > > It works now!
> > >
> > > thank you!
> > >
> > > On Fri, May 18, 2012 at 6:23 PM, Arjan Scherpenisse
> > > <ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>
> > <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>>> wrote:
> > >
> > > That might be the case. What happens if you create a key
> without a
> > > password, does the error stil occur?
> > >
> > > On 05/18/2012 10:36 AM, Barco You wrote:
> > > > So, could you please give a suggestion to solve this
> problem? I
> > > suspect
> > > > maybe because my Key file has password (when I create the
> > key file
> > > with
> > > > openssl, it prompts me to input a pem pass phrase). But in
> > the config
> > > > file of Zotonic there is nowhere to provide this password
> > info. How do
> > > > you think?
> > > >
> > > > thank you!
> > > >
> > > > On Fri, May 18, 2012 at 4:20 PM, Arjan Scherpenisse
> > > > <ar...@scherpenisse.net
> <mailto:ar...@scherpenisse.net> <mailto:ar...@scherpenisse.net
> <mailto:ar...@scherpenisse.net>>
> > <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>
> <mailto:ar...@scherpenisse.net <mailto:ar...@scherpenisse.net>>>

Barco You

unread,
May 18, 2012, 10:20:47 AM5/18/12
to zotoni...@googlegroups.com
Sorry for making trouble.

I will follow your standard next time:)

Best regards,
Barco
Reply all
Reply to author
Forward
0 new messages