Support STARTTLS between ZNC and server. [$10] #363

Closed
opened 2026-10-05 04:15:30 +02:00 by adam · 11 comments
Owner

After a few days of researching, I've found out that ZNC while it does act on the numeric for STARTTLS.

It actually never sends the "STARTTLS" Command to start the connection. If the server reports "tls" in CAP LS, znc should send "STARTTLS" to the IRC server and then the IRC server will respond with the raw numeric and znc should in theory finish it from there.

There is a $10 open bounty on this issue. Add to the bounty at Bountysource.

After a few days of researching, I've found out that ZNC while it does act on the numeric for STARTTLS. It actually never sends the "STARTTLS" Command to start the connection. If the server reports "tls" in CAP LS, znc should send "STARTTLS" to the IRC server and then the IRC server will respond with the raw numeric and znc should in theory finish it from there. ## <bountysource-plugin> There is a **[$10 open bounty](https://www.bountysource.com/issues/3337817-support-starttls-between-znc-and-server-10?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github)** on this issue. Add to the bounty at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1759&utm_medium=issues&utm_source=github). </bountysource-plugin> <!-- github-sync-id:38789702 -->
adam closed this issue 2026-10-05 04:15:30 +02:00
Author
Owner

AFAIK ZNC does NOT support STARTTLS, because we can't really make sure that nothing else sends anything between STARTTLS and the reply to STARTTLS. If that were to happen, the SSL connection would break.

(Why do we handle that numeric at all? :-/)

AFAIK ZNC does NOT support STARTTLS, because we can't really make sure that nothing else sends anything between STARTTLS and the reply to STARTTLS. If that were to happen, the SSL connection would break. (Why do we handle that numeric at all? :-/) <!-- github-comment-id:50306555 -->
Author
Owner

because we can't really make sure that nothing else sends anything between STARTTLS and the reply to STARTTLS.

Other clients must be able to handle this.

> because we can't really make sure that nothing else sends anything between STARTTLS and the reply to STARTTLS. Other clients must be able to handle this. <!-- github-comment-id:68625800 -->
Author
Owner

@md-5 ZNC is the client in this case. Perhaps need a separate bug for the other side.

What ZNC can send to server in between:

  • some modules can send anything
  • some client sends ZNC message to a channel, and core passes it through to server
  • PING if ZNC didn't get anything from server for a while
  • PONG if server pinged ZNC before replying to STARTTLS
  • etc
@md-5 ZNC is the client in this case. Perhaps need a separate bug for the other side. What ZNC can send to server in between: - some modules can send anything - some client sends ZNC message to a channel, and core passes it through to server - PING if ZNC didn't get anything from server for a while - PONG if server pinged ZNC before replying to STARTTLS - etc <!-- github-comment-id:68627249 -->
Author
Owner

@DarthGandalf my point being, STARTTLS must be possible, otherwise it wouldn't exist. ZNC just needs the necessary changes :)

@DarthGandalf my point being, STARTTLS must be possible, otherwise it wouldn't exist. ZNC just needs the necessary changes :) <!-- github-comment-id:68627421 -->
Author
Owner

Given the tls spec which contains the STARTTLS command is deprecated, perhaps this feature request should be closed.

As per https://ircv3.net/specs/extensions/tls-3.1:

This specification has been deprecated. We do not recommend implementing this specification or the features described here.

This extension has been deprecated in favour of encouraging IRC networks to use implicit TLS and deploy Strict Transport Security instead. This is in alignment with the recommendations given in RFC 8314.

Given the tls spec which contains the STARTTLS command is deprecated, perhaps this feature request should be closed. As per https://ircv3.net/specs/extensions/tls-3.1: > This specification has been deprecated. We do not recommend implementing this specification or the features described here. > This extension has been deprecated in favour of encouraging IRC networks to use implicit TLS and deploy Strict Transport Security instead. This is in alignment with the recommendations given in RFC 8314. <!-- github-comment-id:629819692 -->
Author
Owner
support STARTTLS or no, what is this than: https://github.com/znc/znc/commit/a25316710d807019f99e3407ffda2e4a87a1f913 <!-- github-comment-id:946140191 -->
Author
Owner

That's a partial implementation of it.

That's a partial implementation of it. <!-- github-comment-id:946150633 -->
Author
Owner

Ok good. Got confused about the deprecation comment. I do not understand how-to be able to send the STARTTLS to server if even actually possible? If the response is implemented.

I tried around with the send_raw module to send STARTTLS command to IRC server but does not upgrade connections to secure connection..

Ok good. Got confused about the deprecation comment. I do not understand how-to be able to send the `STARTTLS` to server if even actually possible? If the response is implemented. I tried around with the send_raw module to send **STARTTLS** command to IRC server but does not upgrade connections to secure connection.. <!-- github-comment-id:947503074 -->
Author
Owner

Probably something else is missing?

Note that STARTTLS support was never finished, so it's not supported. Feel free to debug it though. But even if you manage to make it work, we probably won't accept the patch, due to this in the spec:

We do not recommend implementing this specification or the features described here.

Probably something else is missing? Note that STARTTLS support was never finished, so it's not supported. Feel free to debug it though. But even if you manage to make it work, we probably won't accept the patch, due to this in the spec: > We do not recommend implementing this specification or the features described here. <!-- github-comment-id:947509251 -->
Author
Owner

Probably something else is missing?

I guess I do it wrong way. Not sure how-to get that enabled. Also this Ideally should be the first that is send to server before anything else get send before connection upgrade to TLS.

Sad. would rather try the connection to optimistically encryption wherever possible than no encryption at all where cleartext.

Than unfortunately this security feature is dead.

BUT THANKS ANYWAY FOR CONFIRMING.

> Probably something else is missing? > I guess I do it wrong way. Not sure how-to get that enabled. Also this Ideally should be the first that is send to server before anything else get send before connection upgrade to TLS. Sad. would rather try the connection to optimistically encryption wherever possible than no encryption at all where cleartext. Than unfortunately this security feature is dead. BUT THANKS ANYWAY FOR CONFIRMING. <!-- github-comment-id:947515005 -->
Author
Owner

May be worth considering sts - strict transport security instead, there is a potential module included in the comments of https://github.com/znc/znc/issues/1647 which may be used for ZNC<>Client upgrades.

May be worth considering [sts - strict transport security](https://ircv3.net/specs/extensions/sts.html) instead, there is a potential module included in the comments of https://github.com/znc/znc/issues/1647 which may be used for ZNC<>Client upgrades. <!-- github-comment-id:947519081 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#363