Colin Steele
2009-Feb-26 06:36 UTC
[Eventmachine-talk] 0.12.4 dies with call SetTlsParms before
I upgraded from 12.2 to 12.4 and found that my happy little eventmachine processes die with: terminate called after throwing an instance of ''std::runtime_error'' what(): call SetTlsParms before calling StartTls Here''s what I believe is the relevant snippet of my code, which calls start_tls() in the connection_completed() callback: connection = EventMachine::Protocols::HttpClient2.connect(args) class << connection def connection_completed logger.debug4 { "Connected to " + dest_host } start_tls if @args[:ssl] super end ....etc Did I miss something about a change in the tls-releated portion of the api? I see that start_tls now takes an optional argument, but that seems unlikely to be causing the error... Looks like Connection#start_tls calls EM::set_tls_params followed by EM::start_tls... which seems to be tripping things up. Am I now required to call EM::start_tls(sig) before EM::Conn#start_tls? Seems odd... Am I missing something? BTW, it works fine with 12.2. -- Colin Steele www.colinsteele.org cvillecsteele at gmail.com Ken Kesey - "Ritual is necessary for us to know anything." -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090226/42f4efed/attachment.html>
Aman Gupta
2009-Feb-26 07:25 UTC
[Eventmachine-talk] 0.12.4 dies with call SetTlsParms before
As of 0.12.4, HttpClient2 will call start_tls when you pass in :ssl => true, so you don''t need to do so yourself. Aman On Thu, Feb 26, 2009 at 10:36 AM, Colin Steele <cvillecsteele at gmail.com> wrote:> I upgraded from 12.2 to 12.4 and found that my happy little eventmachine > processes die with: > > terminate called after throwing an instance of ''std::runtime_error'' > ? what():? call SetTlsParms before calling StartTls > > Here''s what I believe is the relevant snippet of my code, which calls > start_tls() in the connection_completed() callback: > > ??? connection = EventMachine::Protocols::HttpClient2.connect(args) > ??? class << connection > ????? def connection_completed > ??????? logger.debug4 { > ????????? "Connected to " + dest_host > ??????? } > ??????? start_tls if @args[:ssl] > ??????? super > ????? end > > ???? ....etc > > Did I miss something about a change in the tls-releated portion of the api? > I see that start_tls now takes an optional argument, but that seems unlikely > to be causing the error...? Looks like Connection#start_tls calls > EM::set_tls_params followed by EM::start_tls... which seems to be tripping > things up.? Am I now required to call EM::start_tls(sig) before > EM::Conn#start_tls?? Seems odd...? Am I missing something? > > BTW, it works fine with 12.2. > > -- > Colin Steele > www.colinsteele.org > cvillecsteele at gmail.com > Ken Kesey - "Ritual is necessary for us to know anything." > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >