False SSL error when joining a network over SSL while K-Lined. #460

Open
opened 2026-10-05 04:22:51 +02:00 by adam · 5 comments
Owner

If you have an K-Line on a network, like freenode for example and try to connect, znc will throw some SSL error, instead of showing the K-Line reason, like a normal IRC client.

[ ** ] Staying open for debugging [pid: 5996]
[ ** ] ZNC - 1.5.0-git-549-cbbd18c - http://znc.in
[2015-01-27 22:47:21.078125] Connecting user/network [KindOne/foobar]
[2015-01-27 22:47:21.078125] TDNS: initiating resolving of [999.999.999.999] and bindhost []
[2015-01-27 22:47:21.093750] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost []
[2015-01-27 22:47:21.156250] IRC::KindOne::foobar == Connected()
[2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [CAP LS]
[2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [NICK KindOne]
[2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...]
[2015-01-27 22:47:22.078125] ConnectQueueTimer done
[2015-01-27 22:47:22.484375] src/Csocket.cpp:602 at src/Csocket.cpp:2020
[2015-01-27 22:47:22.484375] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
[2015-01-27 22:47:22.484375] src/Csocket.cpp:602 at src/Csocket.cpp:3325
[2015-01-27 22:47:22.484375] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
[2015-01-27 22:47:22.484375] IRC::KindOne::foobar == SockError(0 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol)
[2015-01-27 22:47:22.484375] IRC::KindOne::foobar == Disconnected()
[2015-01-27 22:47:22.484375] Connecting user/network [KindOne/foobar]
[2015-01-27 22:47:22.484375] TDNS: initiating resolving of [999.999.999.999] and bindhost []
[2015-01-27 22:47:22.484375] ConnectQueueTimer done
[2015-01-27 22:47:22.484375] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost []
[2015-01-27 22:47:22.562500] IRC::KindOne::foobar == Connected()
[2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [CAP LS]
[2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [NICK KindOne]
[2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...]
[2015-01-27 22:47:32.953125] src/Csocket.cpp:602 at src/Csocket.cpp:3325
[2015-01-27 22:47:32.953125] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
[2015-01-27 22:47:32.953125] IRC::KindOne::foobar == SockError(0 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol)
[2015-01-27 22:47:32.953125] IRC::KindOne::foobar == Disconnected()
[2015-01-27 22:47:32.953125] Connecting user/network [KindOne/foobar]
[2015-01-27 22:47:32.953125] TDNS: initiating resolving of [999.999.999.999] and bindhost []
[2015-01-27 22:47:32.953125] ConnectQueueTimer done
[2015-01-27 22:47:32.953125] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost []
[2015-01-27 22:47:33.187500] IRC::KindOne::foobar == Connected()
[2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [CAP LS]
[2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [NICK KindOne]
[2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...]
[2015-01-27 22:47:42.921875] IRC::KindOne::foobar == SockError(104 Connection reset by peer)
[2015-01-27 22:47:42.921875] IRC::KindOne::foobar == Disconnected()
[2015-01-27 22:47:42.921875] Connecting user/network [KindOne/foobar]
[2015-01-27 22:47:42.921875] TDNS: initiating resolving of [999.999.999.999] and bindhost []
[2015-01-27 22:47:42.921875] ConnectQueueTimer done
[2015-01-27 22:47:42.921875] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost []
[2015-01-27 22:47:43.437500] IRC::KindOne::foobar == Connected()
[2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [CAP LS]
[2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [NICK KindOne]
[2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...]
[ ** ] Exiting on SIG [2]
[2015-01-27 22:47:45.046875] IRC::KindOne::foobar == Disconnected()

And some lovely output in the IRC client.
<*status> Disconnected from IRC (error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol). Reconnecting...
<*status> Disconnected from IRC. Reconnecting...
<*status> Disconnected from IRC (error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol). Reconnecting...
<*status> Disconnected from IRC. Reconnecting...
<*status> Disconnected from IRC (Connection reset by peer). Reconnecting...
<*status> Disconnected from IRC. Reconnecting...

ZNC should at least show the K-Line message while using SSL, to prevent confusion.

23:02:36 !irc.foobar.com *** Looking up your hostname...
23:02:37 !irc.foobar.com *** Checking Ident
23:02:37 !irc.foobar.com *** Couldn't look up your hostname
23:02:46 !irc.foobar.com *** No Ident response
23:02:46 -!- You are banned from this server- Temporary K-line 1440 min. - Joining #meh (2015/1/27 22.41)
23:02:46 -!- ERROR Closing Link: 99.99.99.99 (*** Banned )
23:02:46 -!- Irssi: Connection lost to 999.999.999.999

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

If you have an K-Line on a network, like freenode for example and try to connect, znc will throw some SSL error, instead of showing the K-Line reason, like a normal IRC client. ``` [ ** ] Staying open for debugging [pid: 5996] [ ** ] ZNC - 1.5.0-git-549-cbbd18c - http://znc.in [2015-01-27 22:47:21.078125] Connecting user/network [KindOne/foobar] [2015-01-27 22:47:21.078125] TDNS: initiating resolving of [999.999.999.999] and bindhost [] [2015-01-27 22:47:21.093750] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost [] [2015-01-27 22:47:21.156250] IRC::KindOne::foobar == Connected() [2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [CAP LS] [2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [NICK KindOne] [2015-01-27 22:47:21.156250] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...] [2015-01-27 22:47:22.078125] ConnectQueueTimer done [2015-01-27 22:47:22.484375] src/Csocket.cpp:602 at src/Csocket.cpp:2020 [2015-01-27 22:47:22.484375] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol [2015-01-27 22:47:22.484375] src/Csocket.cpp:602 at src/Csocket.cpp:3325 [2015-01-27 22:47:22.484375] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol [2015-01-27 22:47:22.484375] IRC::KindOne::foobar == SockError(0 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol) [2015-01-27 22:47:22.484375] IRC::KindOne::foobar == Disconnected() [2015-01-27 22:47:22.484375] Connecting user/network [KindOne/foobar] [2015-01-27 22:47:22.484375] TDNS: initiating resolving of [999.999.999.999] and bindhost [] [2015-01-27 22:47:22.484375] ConnectQueueTimer done [2015-01-27 22:47:22.484375] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost [] [2015-01-27 22:47:22.562500] IRC::KindOne::foobar == Connected() [2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [CAP LS] [2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [NICK KindOne] [2015-01-27 22:47:22.562500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...] [2015-01-27 22:47:32.953125] src/Csocket.cpp:602 at src/Csocket.cpp:3325 [2015-01-27 22:47:32.953125] src/Csocket.cpp:607 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol [2015-01-27 22:47:32.953125] IRC::KindOne::foobar == SockError(0 error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol) [2015-01-27 22:47:32.953125] IRC::KindOne::foobar == Disconnected() [2015-01-27 22:47:32.953125] Connecting user/network [KindOne/foobar] [2015-01-27 22:47:32.953125] TDNS: initiating resolving of [999.999.999.999] and bindhost [] [2015-01-27 22:47:32.953125] ConnectQueueTimer done [2015-01-27 22:47:32.953125] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost [] [2015-01-27 22:47:33.187500] IRC::KindOne::foobar == Connected() [2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [CAP LS] [2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [NICK KindOne] [2015-01-27 22:47:33.187500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...] [2015-01-27 22:47:42.921875] IRC::KindOne::foobar == SockError(104 Connection reset by peer) [2015-01-27 22:47:42.921875] IRC::KindOne::foobar == Disconnected() [2015-01-27 22:47:42.921875] Connecting user/network [KindOne/foobar] [2015-01-27 22:47:42.921875] TDNS: initiating resolving of [999.999.999.999] and bindhost [] [2015-01-27 22:47:42.921875] ConnectQueueTimer done [2015-01-27 22:47:42.921875] TDNS: IRC::KindOne::foobar, connecting to [999.999.999.999] using bindhost [] [2015-01-27 22:47:43.437500] IRC::KindOne::foobar == Connected() [2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [CAP LS] [2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [NICK KindOne] [2015-01-27 22:47:43.437500] (KindOne/foobar) ZNC -> IRC [USER KindOne "KindOne" "KindOne" :...] [ ** ] Exiting on SIG [2] [2015-01-27 22:47:45.046875] IRC::KindOne::foobar == Disconnected() ``` And some lovely output in the IRC client. `<*status> Disconnected from IRC (error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol). Reconnecting...` `<*status> Disconnected from IRC. Reconnecting...` `<*status> Disconnected from IRC (error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol). Reconnecting...` `<*status> Disconnected from IRC. Reconnecting...` `<*status> Disconnected from IRC (Connection reset by peer). Reconnecting...` `<*status> Disconnected from IRC. Reconnecting...` ZNC should at least show the K-Line message while using SSL, to prevent confusion. `23:02:36 !irc.foobar.com *** Looking up your hostname...` `23:02:37 !irc.foobar.com *** Checking Ident` `23:02:37 !irc.foobar.com *** Couldn't look up your hostname` `23:02:46 !irc.foobar.com *** No Ident response` `23:02:46 -!- You are banned from this server- Temporary K-line 1440 min. - Joining #meh (2015/1/27 22.41)` `23:02:46 -!- ERROR Closing Link: 99.99.99.99 (*** Banned )` `23:02:46 -!- Irssi: Connection lost to 999.999.999.999` ## <bountysource-plugin> Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8088152-false-ssl-error-when-joining-a-network-over-ssl-while-k-lined?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:55712397 -->
Author
Owner

This is similar to #320 that ZNC needs to detect whether peer talks SSL or not.

This is similar to #320 that ZNC needs to detect whether peer talks SSL or not. <!-- github-comment-id:71948936 -->
Author
Owner

Is there a fix for this yet? Because I cannot connect to #freenode now with SSL. It keeps disconnecting me, but without SSL it works fine... Any suggestion? :) I am on ZNC 1.4

Is there a fix for this yet? Because I cannot connect to #freenode now with SSL. It keeps disconnecting me, but without SSL it works fine... Any suggestion? :) I am on ZNC 1.4 <!-- github-comment-id:72701987 -->
Author
Owner

No there isn't. If you can connect without SSL, this is separate issue. What is the error message you get and are you sure that you have + in front of the SSL port number?

No there isn't. If you can connect without SSL, this is separate issue. What is the error message you get and are you sure that you have `+` in front of the SSL port number? <!-- github-comment-id:72702314 -->
Author
Owner

I can connect with SSL but when I do that i get the exact same error as described above.. so I switched to NON-SSL. ;) That works fine.

And yes of course I had a + infront of the port number ;)

I can connect with SSL but when I do that i get the exact same error as described above.. so I switched to NON-SSL. ;) That works fine. And yes of course I had a + infront of the port number ;) <!-- github-comment-id:72719708 -->
Author
Owner

You can check to see if the IP is banned by loading up 2 SSH terminals (I'm presuming you're using a Debian based Linux system here) and running 1 of the commands in each.

  1. socat tcp-l:12345,reuseaddr,fork 'tcp:[IPv4/IPv6 of the network you're connecting too]:6697,bind=[Your system's IPv4/IPv6 address]'
    2 ) gnutls-cli -p 12345 --insecure -V 127.0.0.1

Please note: Don't remove the ['s and ]'s on the first command.

You can check to see if the IP is banned by loading up 2 SSH terminals (I'm presuming you're using a Debian based Linux system here) and running 1 of the commands in each. 1) socat tcp-l:12345,reuseaddr,fork 'tcp:[IPv4/IPv6 of the network you're connecting too]:6697,bind=[Your system's IPv4/IPv6 address]' 2 ) gnutls-cli -p 12345 --insecure -V 127.0.0.1 Please note: Don't remove the ['s and ]'s on the first command. <!-- github-comment-id:72724547 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#460