00:42:32  * a_lequit (Read error: Connection reset by peer)
00:46:47  * DarkGodquit (Ping timeout: 272 seconds)
01:01:40  * kazuponjoined
01:03:35  * creationixquit (Ping timeout: 265 seconds)
01:07:21  * a_lejoined
01:08:35  * a_lequit (Read error: Connection reset by peer)
01:08:54  * rjequit (Ping timeout: 265 seconds)
01:08:58  * jirwinquit (Ping timeout: 272 seconds)
01:08:58  * songgaoquit (Ping timeout: 265 seconds)
01:09:03  * a_lejoined
01:10:06  * songgaojoined
01:17:32  * jirwinjoined
01:21:54  * creationixjoined
01:21:57  * rjejoined
02:25:07  * a_lequit (Remote host closed the connection)
04:09:19  * a__quit (Read error: Connection reset by peer)
04:09:28  * a__joined
04:10:38  * kazuponquit (Remote host closed the connection)
04:16:30  * a__quit (Remote host closed the connection)
04:25:53  * a__joined
04:27:04  * a__quit (Remote host closed the connection)
04:27:53  * a__joined
04:47:05  * kazuponjoined
07:07:30  * a_lejoined
07:13:51  * a_lequit (Remote host closed the connection)
07:44:23  * a_lejoined
07:50:42  * a_lequit (Ping timeout: 250 seconds)
07:59:59  * kazuponquit (Remote host closed the connection)
08:00:52  * kazuponjoined
08:05:24  * kazuponquit (Ping timeout: 256 seconds)
10:07:50  * a_lejoined
10:12:26  * a_lequit (Ping timeout: 258 seconds)
11:52:42  * kazuponjoined
12:06:04  * kazuponquit (Remote host closed the connection)
12:45:09  * kazuponjoined
13:09:59  * a_lejoined
13:14:31  * a_lequit (Ping timeout: 258 seconds)
13:31:35  <rphillips>creationix: https://gist.github.com/rphillips/b20ae3ef6819f410dcf5
13:31:50  <rphillips>I could use your help trying to get the handshake ported over
13:32:12  <rphillips>it looks right to me, but i'm not familiar with the luv API
14:00:19  * kazuponquit (Remote host closed the connection)
14:04:48  * kazuponjoined
14:52:13  * kazuponquit (Remote host closed the connection)
14:53:35  <rphillips>creationix: https://ci.appveyor.com/project/creationix/luvi/build/1.0.69
14:53:38  <rphillips>tis building
14:57:37  <rphillips>creationix: can you add me as a collabator on appveyor?
14:58:15  <rphillips>looks like you can add 'github teams'
14:59:47  <rphillips>https://ci.appveyor.com/api/buildjobs/kvjcus73740a6bly/artifacts/luvi.exe
15:02:13  <rphillips>works :)
15:03:52  <creationix>rphillips: any idea where I add collaborators?
15:04:31  <rphillips>your account name should have 'team'
15:04:43  <rphillips>in the upper right
15:05:04  <creationix>hmm, it’s asking for an email
15:05:13  <creationix>what’s your github account email?
15:05:59  <creationix>nevermind, I found the github team part
15:06:00  <rphillips>trolocsis at gmail.com
15:06:52  <creationix>ok, added luvit-admin team as admins on appveyor
15:07:22  <creationix>now you should be able to cancel builds you don’t need to speed things up
15:08:32  <rphillips>sweet
15:09:07  <creationix>rphillips: still need help with the lua sample?
15:09:12  <creationix>I’m about to head to my office finally
15:09:25  <rphillips>creationix: yeah, i would really like to get the ssl handshake ported over
15:11:10  * a_lejoined
15:13:39  <rphillips>cancelled the told builds
15:13:43  <rphillips>old*
15:15:38  <rphillips>cmake --build is slick
15:15:46  <rphillips>that makes things easier
15:16:25  * a_lequit (Ping timeout: 264 seconds)
15:19:17  <creationix>I know right
15:22:53  <creationix>rphillips: alright, I’m at my desk now. can you post that gist again. My irc sessions don’t transfer histroy
15:22:56  <creationix>*history
15:23:33  <rphillips>https://gist.github.com/rphillips/b20ae3ef6819f410dcf5
15:34:01  <rphillips>the openssl branch is ready for review
15:34:10  <creationix>awesome
15:48:18  <creationix>rphillips: I’m getting a compile error
15:48:42  <creationix>missing lua compat header
15:49:14  <creationix>ahh, it was a recursive dependency
15:49:50  <creationix>git submodule update —init —recursive && make clean large && make
15:55:20  <creationix>rphillips: ok, got it built.
15:55:49  <creationix>so what’s the high-level process of a tls handshake?
15:56:08  <creationix>(btw, SSLv3 should be disabled on most servers now to avoid the poodle vuln.)
15:56:24  <creationix>TLS 1.2 is the preferred protocol I believe
15:57:17  <rphillips> it is
15:57:21  <rphillips>true
15:57:34  <rphillips>high level process is to keep calling ssl:handshake
15:57:54  <rphillips>in openssl, there are buffers called BIOs
15:58:06  <rphillips>so they push data to and from the sockets to the BIOs and back
15:58:15  <rphillips>like a pumpt
15:58:17  <rphillips>pump
15:59:19  <creationix>so we just need to hook the BIOs to the two ends of the real TCP socket and keep trying
16:03:03  * kazuponjoined
16:07:21  * kazuponquit (Ping timeout: 244 seconds)
16:27:16  <creationix>ok, I just requested a startssl cert for luvit.io so it can be hosted on https
16:27:35  <creationix>I think it’s best if luvit’s tls tests go against it’s own server
16:32:27  * UniOnjoined
16:44:28  <rphillips>+1
16:54:10  * a_lejoined
17:02:33  <creationix>https://luvit.io/
17:02:34  <creationix>success!
17:03:05  <creationix>one of these days I need to do the identity verification so I can get wildcard subdomains for my certs
17:08:20  <rphillips>sweet!
17:08:34  <rphillips>what was I missing out of the ssl handshake code?
17:30:15  <creationix>not sure, still looking
17:30:42  <rphillips>ah, misread the above
17:30:45  <creationix>I don’t think this worked https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-ssl-lua-L207
17:30:59  <creationix>there is no `new_ctx` method on the ssl module, just `ctx_new`
17:31:32  <creationix>so far I’ve created a tls context and made the tcp connection to port 443 on luvit.io after doing dns resolving
17:34:05  <creationix>rphillips: this is what I have so far https://gist.github.com/creationix/f6b5cf03a34b4002ddb5
17:39:41  <creationix>nevermind, I found what it was pointing to, there are so many variables with the same name, but different meanings in this code, it’s confusing
18:06:39  <creationix>alright, loaded root ca for startcom so I can test verify https://gist.github.com/creationix/f6b5cf03a34b4002ddb5#file-tls-connect-luvit-lua-L26
18:06:59  <creationix>you wouldn’t happen to know how to tell lua-openssl to use this root ca and verify
18:11:47  <creationix>docs help :) http://zhaozg.github.io/lua-openssl/modules/ssl.html
18:14:01  <rch>wow docs
18:25:25  * jirwinquit (Changing host)
18:25:25  * jirwinjoined
18:32:30  <creationix>rphillips: any idea what this `ssl` method is
18:32:47  <creationix>https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-ssl-lua-L198
18:33:33  <rphillips>creationix: should be a lightuserdata for the ssl context in C
18:33:59  <creationix>I mean the function being called `ctx:ssl()`
18:34:16  <creationix>I don’t see it in the docs or in the metatable’s __index and it’s nil on my context
18:34:46  <creationix>I assume ctx:bio uses his own I/O (appears to be my old luv bindings actually)
18:36:42  <creationix>I’m pretty sure `ctx` is a userdata with “class” openssl.ssl_ctx
18:37:02  <rphillips>https://github.com/zhaozg/lua-openssl/blob/a0f6894c01d2907200c48c751ee62313c743a6ec/src/ssl.c#L921
18:37:44  <rphillips>calls SSL_new(ctx);
18:37:52  <rphillips>with optional BIOs
18:39:50  <creationix>strange, I wonder why I don’t have that function
18:40:04  <creationix>I see all the others in getmetatable(ctx).__index
18:40:45  <creationix>nevermind, it is there
18:40:50  * creationixmust need new glasses or something
18:42:58  <creationix>but is *is* missing from the docs. There are a lot of errors and wrong information there
18:46:24  <creationix>rphillips: ok, so `inp` is which direction? plaintext going into ssl or plaintext coming out of ssl?
18:46:41  <creationix>input to plain stream or input to crypt stream
18:48:18  <rphillips>good question
18:50:17  <rphillips>it's the encrypted data input
18:50:18  <rphillips>i think
18:57:10  <rphillips>https://gist.github.com/roxlu/3999827
18:57:24  <rphillips>a libuv client that does this same thing
19:00:21  <creationix>hmm, it just hangs when I call :handshake()
19:02:48  <rphillips>hmm. it is toggling back and forth for me
19:11:39  <creationix>yeah, I trace it with wireshark and calling :handshake never sends anything over the tcp connection
19:12:01  <creationix>which makes sense, I’m never calling write on my uv side
19:12:08  <creationix>but how do I get data out of it then?
19:12:19  <creationix>I attached callbacks to both input and output bios
19:12:23  <creationix>they never get called
19:17:13  <rphillips>local i, o = self.out:pending()
19:17:50  <rphillips>this should have data in it
19:17:57  <rphillips> uv.write(self.socket, self.out:read(), function()
19:21:56  <creationix>rphillips: you’re right, it started out with data and they never called the callback assuming I would check there first
19:22:10  <rphillips>i get 126 bytes written to the socket
19:22:18  <rphillips>then 0 for some reason
19:24:50  <rphillips>openssl s_client -connect ip:port -debug
19:24:57  <rphillips>you can see the initial handshake
19:25:56  <rphillips>hmm. then it reads a lot
19:27:10  <rphillips>the :handshake in the ondata event is wrong I think
19:29:08  <creationix>I’m getting the cert from luvit.io
19:29:27  <creationix>it still never calls the onHandshake callback (or any callback in lua-openssl)
19:38:51  <rphillips>does the uv.write callback get called?
19:39:30  <creationix>rphillips: do you know why https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-ssl-lua-L123 is reading from self.ssl and not self.inp?
19:40:33  <rphillips>that section doesn't happen until it successfully handshakes
19:40:45  <creationix>yep, my onwrite happens
19:41:20  <rphillips>it switches to sending cleartext to the bio then encrypted on the wire
19:42:35  <creationix>I’m starting to understand this, slowly
19:42:50  <creationix>I keep confusing the raw APIs with the wrappers in your code
19:55:19  <rphillips>yeah
20:04:46  <rphillips>creationix: does the socket need to be added to the event loop more than once?
20:04:47  <rphillips>for a read
20:06:45  <creationix>rphillips: nope, just one read_start is needed
20:07:44  <rphillips>oh man
20:07:54  <rphillips> protocol = "TLSv1_client",
20:07:57  <rphillips>looks like it worked
20:08:01  <rphillips>for the most part
20:08:20  <creationix>alright, I got handshake to return true!
20:09:42  <rphillips>nice
20:10:45  <creationix>now to figure out a sane stream API between the BIO interface and uv_tcp_t
20:10:57  <creationix>I think I’ll just return the raw bios for now, just to test it
20:20:48  <creationix>I don’t think ssl:set_callback does anything
20:21:07  <creationix>oh well, my libuv read callbacks tell me when I should look in the output queues on the BIOs
20:23:19  <rphillips>i updated my gist
20:23:23  <rphillips>with what is working for me
20:23:42  <creationix>cool, mine is working too. I’m cleaning up my code to use sane APIs
20:23:50  <rphillips>nice
20:24:11  <rphillips>this is quite nice
20:24:23  <creationix>I’m wrapping the uv stream and the openssl bios to both look like https://github.com/creationix/culvert
20:24:35  <creationix>this is the stream/channel interface I use in js-git for complex operations. It’s really nice
20:24:54  <rphillips>that will be slick
20:24:59  <creationix>and with optional coroutine support, it can block on drain and take instead of needing a callback
20:25:17  <creationix>(I’ll just block if you’re in a coroutine and didn’t pass in a callback)
20:32:03  <rphillips>1.3 MB RSS memory
20:32:14  <rphillips>luvi w/ ssl connected to my ssl endpoint
20:35:38  <creationix>nice
20:37:00  <rch>nice
20:39:43  <rphillips>interesting... if you strip the luvi executable it removes the init module
20:40:09  <creationix>OSX?
20:40:47  <creationix>oh, it strips the lua bytecode? We saw that before I think and had a nasty hack to preserve it
20:41:13  <creationix>wasn’t that what https://github.com/luvit/luvit/blob/master/src/luvit_exports.c was for?
20:42:48  <rphillips>right
20:43:16  <rch>aha that's where this is from: https://github.com/virgo-agent-toolkit/virgo-base-agent/blob/9c75e0372a92c8a3ce7e56855ccf94cd944f432d/lib/virgo_exports.c
20:43:17  <rphillips>creationix: did you see the returned context has a :write() method for cleartext?
20:43:34  <creationix>no, that’s handy
20:43:41  <creationix>can you read cleartext from it too?
20:43:50  <rphillips>https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-ssl-lua-L170
20:43:56  <rphillips>i updated it so it works
20:44:32  <rphillips>this is where the cleartext comes from https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-ssl-lua-L125
20:44:39  <rphillips>it needs an event emitter or something
20:45:22  <rphillips>example: https://gist.github.com/rphillips/b20ae3ef6819f410dcf5#file-gistfile1-txt-L8
20:46:05  <creationix>yeah, my channel interface wrapper will make it much easier to consume
20:47:37  <rphillips>cool
21:32:48  * a__quit (Remote host closed the connection)
21:35:52  * a__joined
21:38:24  * dan336joined
21:41:51  <dan336>hey guys, is there a builtin tool for finding memory leaks? I've got a project I'm working on and I can't manage to see why its memory is growing.
22:21:20  <creationix>dan336: I don’t know of any, but I’ll bet there are memory profilers for luajit
22:21:29  <creationix>if the issue is in the C bindings, valgrind is sometimes helpful
22:27:15  <dan336>alright, thanks.
22:29:32  <rphillips>instruments on osx is great as well
22:36:48  <rphillips>dinner
22:39:35  <creationix>rphillips: enjoy
22:43:50  * DarkGodjoined
23:01:40  <dan336>ok so instruments on mac is reporting that the buffers for udp messages aren't being released.
23:04:00  * dan336quit (Quit: Leaving.)
23:04:47  <creationix>I believe it. UDP has little use
23:10:26  <rch>heh
23:12:13  <creationix>I mean it’s been used little
23:12:15  <creationix>:)
23:38:03  <rch>i enjoyed both interpretations
23:40:08  * travis-cijoined
23:40:08  <travis-ci>luvit/luvit#967 (luvi-up - d053571 : Tim Caswell): The build was broken.
23:40:08  <travis-ci>Change view : https://github.com/luvit/luvit/compare/1b0a9c8d5bb2...d05357145651
23:40:08  <travis-ci>Build details : http://travis-ci.org/luvit/luvit/builds/39551005
23:40:08  * travis-cipart
23:42:21  <rphillips>those in-line functions should have local declarations
23:47:49  * kazuponjoined
23:49:16  * kazupon_joined
23:49:23  * kazuponquit (Read error: Connection reset by peer)
23:53:43  * kazupon_quit (Remote host closed the connection)