Opened 6 years ago

Last modified 5 years ago

#15625 new enhancement

IRC plugin uses incorrect port for SSL

Reported by: andy753421 Owned by: elb
Milestone: Patches Needing Review Component: IRC
Version: 2.10.7 Keywords: irc ssl tls
Cc:

Description

There are two problems here:

First, the IRC plugin has the default SSL port defined as 994, which is technically correct, but hardly ever used. (Does anyone ever connect to IRC on port 194 either?) A better choice would be port 6697, as discussed here: http://blog.freenode.net/2011/02/port-6697-irc-via-tlsssl/

Second, the default SSL port setting probably isn't even used because the settings dialog defaults the "port" to 6667 which overrides the SSL port default.

I can either add a second option to the dialog for the SSL port, or we could set the dialog default to something like 0 or -1, and then pick the correct default in software. Does anyone have a preference?

Note: I would also like to change the "Use SSL" option to a drop down with "Required", "Optional", and "Never", so maybe having a second port setting would be better for the "Optional" case.

Attachments (1)

add-and-fix-irc-ssl-ports.diff (3.0 KB) - added by belmyst 5 years ago.
Fixes the SSL port issue by redefining it as a string.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 5 years ago by belmyst

From my reading of irc.c, it's easy to change the default SSL port to 6697, but since on account creation the preference port

option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT);
	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);

is set to the default port (6667),

	purple_connection_update_progress(gc, _("Connecting"), 1, 2);

	if (purple_account_get_bool(account, "ssl", FALSE)) {
		if (purple_ssl_is_supported()) {
			irc->gsc = purple_ssl_connect(account, irc->server,
					purple_account_get_int(account, "port", IRC_DEFAULT_SSL_PORT),
					irc_login_cb_ssl, irc_ssl_connect_failure, gc);

will fail to use the correct port.

I believe this could be fixed by:

  • not setting a default port in
    option = purple_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT);
    	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
    
    which should let the code above use the default ports.
  • perhaps adding STARTTLS to IRC. But this requires both client and server support.

The submitted patch deals with this by treating the port as a string. The empty string means we should decide the port using the SSL preferences (6667 vs 6697), whereas anything different would be interpreted as user-set and thus would be used as-is. Please note that this does not add any handling behaviour for previously saved accounts (where port is an integer).

Any comments are more than welcome.

Last edited 5 years ago by belmyst (previous) (diff)

Changed 5 years ago by belmyst

Fixes the SSL port issue by redefining it as a string.

comment:2 Changed 5 years ago by Robby

  • Milestone set to Patches Needing Review
Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!