|
I am using SSL sockets to talk between an erlang program and a twisted python program. Different processes in my erlang app occasionally have to open connections and the first one opens fine, then the second errors with {error, closed}.
I don't know if I am misunderstanding something in SSL or Erlang. The simplest client code I could come up with is: run_test()-> ssl:start(), %%% works fine
{ok, Conn} = ssl:connect("localhost", 2000, [binary, {packet, 0}, {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, "controller.key"} ]), %%% this next one will return {error, closed}
{ok, Conn1} = ssl:connect("localhost", 2000, [binary, {packet, 0}, {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, "controller.key"} ]). The python side gets the connection both times. Bizarrely, if I retry a connection after getting {error, closed} it works. Any insight? Dan
_______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Hi!
It sounds like you are experiencing some kind of timing problem. I tried to write a test case to repeat it but I am not getting any problem. Which ssl-version you are running? Regards Ingela Erlang/OTP team - Ericsson AB 2011/7/2 Daniel Griffin <[hidden email]>: > I am using SSL sockets to talk between an erlang program and a twisted > python program. Different processes in my erlang app occasionally have to > open connections and the first one opens fine, then the second errors with > {error, closed}. > I don't know if I am misunderstanding something in SSL or Erlang. The > simplest client code I could come up with is: > run_test()-> > ssl:start(), > %%% works fine > {ok, Conn} = ssl:connect("localhost", 2000, [binary, {packet, 0}, > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, > "controller.key"} ]), > %%% this next one will return {error, closed} > {ok, Conn1} = ssl:connect("localhost", 2000, [binary, {packet, 0}, > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, > "controller.key"} ]). > > The python side gets the connection both times. Bizarrely, if I retry a > connection after getting {error, closed} it works. > Any insight? > Dan > > > _______________________________________________ > erlang-questions mailing list > [hidden email] > http://erlang.org/mailman/listinfo/erlang-questions > > erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
The twisted python server defaults to accepting SSL 2 or 3. I am using erlang R14B01. Is there some rule saying that you can't have multiple SSL connections between 2 programs?
What sort of timing issues could I be having?
Thanks, Dan On Mon, Jul 4, 2011 at 4:00 AM, Ingela Andin <[hidden email]> wrote: Hi! _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Hi again!
2011/7/4 Daniel Griffin <[hidden email]>: > The twisted python server defaults to accepting SSL 2 or 3. I am using > erlang R14B01. Is there some rule saying that you can't have multiple SSL > connections between 2 programs? No, it should not be a problem. > What sort of timing issues could I be having? I will investigate tomorrow if there could be some sort of timing issue. I am not saying there is, I am just saying your description of what is happening makes me think of strange timing issues, (even though I can not think of a reason there should be sush an isssue at the moment) but I had very little to go on. Knowing which version of the code you are running makes it easier. If you have the possibility to try the latest version of the code or atleast R14B03 that would be good. Regards Ingela Erlang/OTP team - Ericsson AB > Thanks, > Dan > On Mon, Jul 4, 2011 at 4:00 AM, Ingela Andin <[hidden email]> wrote: >> >> Hi! >> >> It sounds like you are experiencing some kind of timing problem. >> I tried to write a test case to repeat it but I am not getting >> any problem. Which ssl-version you are running? >> >> Regards Ingela Erlang/OTP team - Ericsson AB >> >> 2011/7/2 Daniel Griffin <[hidden email]>: >> > I am using SSL sockets to talk between an erlang program and a twisted >> > python program. Different processes in my erlang app occasionally have >> > to >> > open connections and the first one opens fine, then the second errors >> > with >> > {error, closed}. >> > I don't know if I am misunderstanding something in SSL or Erlang. The >> > simplest client code I could come up with is: >> > run_test()-> >> > ssl:start(), >> > %%% works fine >> > {ok, Conn} = ssl:connect("localhost", 2000, [binary, {packet, 0}, >> > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, >> > {keyfile, >> > "controller.key"} ]), >> > %%% this next one will return {error, closed} >> > {ok, Conn1} = ssl:connect("localhost", 2000, [binary, {packet, 0}, >> > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, >> > {keyfile, >> > "controller.key"} ]). >> > >> > The python side gets the connection both times. Bizarrely, if I retry a >> > connection after getting {error, closed} it works. >> > Any insight? >> > Dan >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > [hidden email] >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > > > erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Hi!
I have not actually pinpointed the problem but I got my test-case to fail on R14B01 but runs fine on R14B02 and R1B03 and on the main development branch. Hence upgrade and let me know how it goes. Regards Ingela Erlang/OTP team - Ericsson AB 2011/7/4 Ingela Andin <[hidden email]>: > Hi again! > > 2011/7/4 Daniel Griffin <[hidden email]>: >> The twisted python server defaults to accepting SSL 2 or 3. I am using >> erlang R14B01. Is there some rule saying that you can't have multiple SSL >> connections between 2 programs? > > No, it should not be a problem. > >> What sort of timing issues could I be having? > > I will investigate tomorrow if there could be some sort of timing > issue. I am not saying > there is, I am just saying your description of what is happening > makes me think of strange timing issues, (even though I can not think > of a reason there should be sush an isssue at the moment) but I had > very little to go on. Knowing which version of the code you are > running makes it easier. If you have the possibility to try the > latest version of the code or atleast R14B03 > that would be good. > > Regards Ingela Erlang/OTP team - Ericsson AB > >> Thanks, >> Dan >> On Mon, Jul 4, 2011 at 4:00 AM, Ingela Andin <[hidden email]> wrote: >>> >>> Hi! >>> >>> It sounds like you are experiencing some kind of timing problem. >>> I tried to write a test case to repeat it but I am not getting >>> any problem. Which ssl-version you are running? >>> >>> Regards Ingela Erlang/OTP team - Ericsson AB >>> >>> 2011/7/2 Daniel Griffin <[hidden email]>: >>> > I am using SSL sockets to talk between an erlang program and a twisted >>> > python program. Different processes in my erlang app occasionally have >>> > to >>> > open connections and the first one opens fine, then the second errors >>> > with >>> > {error, closed}. >>> > I don't know if I am misunderstanding something in SSL or Erlang. The >>> > simplest client code I could come up with is: >>> > run_test()-> >>> > ssl:start(), >>> > %%% works fine >>> > {ok, Conn} = ssl:connect("localhost", 2000, [binary, {packet, 0}, >>> > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, >>> > {keyfile, >>> > "controller.key"} ]), >>> > %%% this next one will return {error, closed} >>> > {ok, Conn1} = ssl:connect("localhost", 2000, [binary, {packet, 0}, >>> > {keepalive, true}, {active, false}, { certfile, "controller.crt"}, >>> > {keyfile, >>> > "controller.key"} ]). >>> > >>> > The python side gets the connection both times. Bizarrely, if I retry a >>> > connection after getting {error, closed} it works. >>> > Any insight? >>> > Dan >>> > >>> > >>> > _______________________________________________ >>> > erlang-questions mailing list >>> > [hidden email] >>> > http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> > >> >> > erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Thanks, I will do that today and respond with results.
Dan
On Tue, Jul 5, 2011 at 8:12 AM, Ingela Andin <[hidden email]> wrote: Hi! _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
|
Upgrading fixed it.
Thanks for the help, Dan
On Tue, Jul 5, 2011 at 9:15 AM, Daniel Griffin <[hidden email]> wrote: Thanks, I will do that today and respond with results. _______________________________________________ erlang-questions mailing list [hidden email] http://erlang.org/mailman/listinfo/erlang-questions |
| Powered by Nabble | Edit this page |
