hoche / cicb

ICB chat client. See www.icb.net
GNU General Public License v3.0
11 stars 4 forks source link

SSL doesn't work. #2

Closed 20centaurifux closed 5 years ago

20centaurifux commented 5 years ago

I'm writing my own ICB server at the moment. I noticed that cicb doesn't handle SSL properly. This pull request should fix the issues :)

  1. select() can't be used to test for incoming data because openssl has its own state. The new code uses SSL_peek() instead.
  2. SSL_peek() will block forever if O_NONBLOCKING isn't set. I had to include fcntl.h in server.c to make it work.
  3. readpacket() tries now to read all remaining bytes if SSL is on.

I have a test server on internetcitizens.band. It supports SSL and Non-SSL connections.

Thanks for your great work!

Sebastian

hoche commented 5 years ago

Ah, yes, thanks. I added the SSL code years ago but never had a server to test it with. I only ever got it to connect to an SSL socket client but nothing beyond that.

Anyway, your patch looks good and I merged it in.

I've been working on the icbd recently and was intending to get SSL working on it in the next week or so but something came up and I'm not going to be able to focus on it for about a month at least.

Are you Schipplock's friend, with the python server?

-hoche

On Sun, Jun 02, 2019 at 06:49:36AM -0700, Sebastian Fedrau wrote:

I'm writing my own ICB server at the moment. I noticed that cicb doesn't handle SSL properly. This pull request should fix the issues :)

  1. select() can't be used to test for incoming data because openssl has its own state. The new code uses SSL_peek() instead.
  2. SSL_peek() will block forever if O_NONBLOCKING isn't set. I had to include fcntl.h in server.c to make it work.
  3. readpacket() tries now to read all remaining bytes if SSL is on.

I have a test server on internetcitizens.band. It supports SSL and Non-SSL connections.

Thanks for your great work!

Sebastian You can view, comment on, or merge this pull request online at:

https://github.com/hoche/cicb/pull/2

-- Commit Summary --

  • make SSL work

-- File Changes --

M icb/getline.c (31)
M icb/server.c (1)

-- Patch Links --

https://github.com/hoche/cicb/pull/2.patch https://github.com/hoche/cicb/pull/2.diff

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/hoche/cicb/pull/2

20centaurifux commented 5 years ago

Yes, I'm writing a server in Python at the moment, just for fun :) schipplock is one of my IRC buddies. We discovered ICB a few weeks ago.