Multiplayer server not connecting.

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Weapons_Master
Posts: 1
Joined: May 29th, 2021, 4:11 am

Multiplayer server not connecting.

Post by Weapons_Master »

I just installed Wesnoth 1.16 onto my new windows 11 laptop. The game launches without error, but when I go to connect to the official server, I get a message saying "Connection failed: certificate verify failed". I have no idea what this means or how to correct it, so advice would be much appreciated!

The Battle for Wesnoth version 1.16.1 x86_64
Running on Microsoft Windows 11 21H2 (10.0.22000) x86_64
Distribution channel: SourceForge

Game paths
==========

Data dir: C:\Program Files\Battle for Wesnoth 1.16.1
User config dir: C:\Users\USER\Documents\My Games\Wesnoth1.16
User data dir: C:\Users\USER\Documents\My Games\Wesnoth1.16
Saves dir: C:\Users\USER\Documents\My Games\Wesnoth1.16\saves
Add-ons dir: C:\Users\USER\Documents\My Games\Wesnoth1.16\data\add-ons
Cache dir: C:\Users\USER\Documents\My Games\Wesnoth1.16\cache

Libraries
=========

Boost: 1.74
Lua: 5.4.2
OpenSSL/libcrypto: 1.1.1i (runtime 1.1.1i)
Cairo: 1.17.4 (runtime 1.17.4)
Pango: 1.48.0 (runtime 1.48.0)
SDL: 2.0.12 (runtime 2.0.12)
SDL_image: 2.0.5 (runtime 2.0.5)
SDL_mixer: 2.0.4 (runtime 2.0.4)

Features
========

Lua console completion: yes
Win32 notifications back end: yes

Current video settings
======================

SDL video drivers: [windows] dummy
Window size: 1280x720
Screen refresh rate: 60
Screen dots per inch: 96.000000x96.000000
Screen dpi scale factor: 1.000000x1.000000

Current audio settings
======================

SDL audio drivers: [wasapi] directsound
Number of channels: 2
Output rate: 44100 Hz
Sample format: signed 16 bit little-endian
Sample size: 4096 bytes

Installed add-ons
=================

No add-ons installed.
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: Multiplayer server not connecting.

Post by demario »

Just dropping a line to say that some good old MP players are still roaming the 1.14 MP server, cause they can't join the main 1.16 MP server.
They appear to be running mainly the BFW1.16 binary from sourceforge on Windows (connecting from Europe).
They report they can connect to BFW1.16 alternate server (server2) without problem (but the lobby is always empty of course).
Is there any known difference on how BFW 1.16 is connecting to official server and server2?
Any feedback is much appreciated.
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer server not connecting.

Post by Pentarctagon »

What does the log contain when Wesnoth is started with --log-debug=network after trying to connect?

The difference would be that the primary server uses TLS, whereas the alternate does not.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: Multiplayer server not connecting.

Post by demario »

Pentarctagon wrote: December 19th, 2021, 6:25 pm The difference would be that the primary server uses TLS, whereas the alternate does not.
Would it make sense the swap the settings?
Namely dropping TLS from the main server until the issue is fixed and enabling it on the alternate for investigation.
It wouldn't have any compatibility issue on the current MP player base that can connect, would it?
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer server not connecting.

Post by Pentarctagon »

For 1.14, the passwords people use to login were hashed client-side and then sent over an unencrypted connection. This wasn't desirable since it meant that the wesnoth client needed to know what hashing algorithm to use in order to match what the forum database was using.

For 1.16, the passwords people use to login are no longer hashed before being sent - instead the connection itself is encrypted to provide security.

---

The issue with some people not being able to connect now that SSL/TLS is being used is known, but we don't know what the cause is or why it only seems to affect a small number of users. My expectation is that the results of enabling network debugging would look similar to this, but right now we're at a dead end as far as why it's not working. I wouldn't be entirely surprised if it ended up being related to geographic location (stranger things have certainly happened), but I also can't think of any reason why the same cert would be valid or invalid based on being in Europe or not.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: Multiplayer server not connecting.

Post by demario »

Pentarctagon wrote: December 19th, 2021, 11:49 pm For 1.14, the passwords people use to login were hashed client-side and then sent over an unencrypted connection. This wasn't desirable since it meant that the wesnoth client needed to know what hashing algorithm to use in order to match what the forum database was using.

For 1.16, the passwords people use to login are no longer hashed before being sent - instead the connection itself is encrypted to provide security.
:hmm:
Do I understand right that TLS-disabled 1.16 should behave like 1.14 (password should be hashed as not encrypted)?
Does the 1.16 code allow a password enabled + TLS disabled setting where the password is hashed automatically if TLS is disabled on the server.
Or there is no such a code and so it seems like all BFW1.16 password enabled servers must use TLS :(
Pentarctagon wrote: December 19th, 2021, 11:49 pm My expectation is that the results of enabling network debugging would look similar to this.
I can't open any steamcommunity link (nor discord ones). Would it be possible to paste the information here?
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer server not connecting.

Post by Pentarctagon »

demario wrote: December 20th, 2021, 12:39 am I can't open any steamcommunity link (nor discord ones). Would it be possible to paste the information here?

Code: Select all

I launched the game with these settings.

Here is a log.
Battle for Wesnoth v1.16.1 x86_64
Started on Tue Nov 09 19:32:11 2021

Automatically found a possible data directory at D:\Steam\steamapps\common\wesnoth

Data directory: D:\Steam\steamapps\common\wesnoth
User configuration directory: C:\Users\USER\Documents\My Games\Wesnoth1.16
User data directory: C:\Users\USER\Documents\My Games\Wesnoth1.16
Cache directory: C:\Users\USER\Documents\My Games\Wesnoth1.16\cache

Setting mode to 2560x1440
Checking lua scripts... ok
20211109 19:32:15 info network: Resolving hostname: addons.wesnoth.org
20211109 19:32:16 info network: Connected to <IP_Address>
20211109 19:32:16 debug network: Written 4 bytes.
20211109 19:32:16 debug network: Verifying TLS certificate: /C=US/O=Internet Security Research Group/CN=ISRG Root X1: verified
20211109 19:32:16 debug network: Verifying TLS certificate: /C=US/O=Let's Encrypt/CN=R3: verified
20211109 19:32:16 debug network: Verifying TLS certificate: /CN=chantal.wesnoth.org: failed
20211109 19:32:16 error network: network_asio::error thrown during transaction with add-on server; "certificate verify failed"
20211109 19:32:16 error general: Remote host disconnected.
The issue seems like it's somehow related to a Let's Encrypt certificate expiring (https://letsencrypt.org/docs/certificate-compatibility/), however at least in the above provided log it's somehow validating ISRG Root X1 but failing on Wesnoth's server (chantal.wesnoth.org). This same person was also able to still successfully access the Wesnoth website even though the same certs are used in both places.
demario wrote: December 20th, 2021, 12:39 am
Pentarctagon wrote: December 19th, 2021, 11:49 pm For 1.14, the passwords people use to login were hashed client-side and then sent over an unencrypted connection. This wasn't desirable since it meant that the wesnoth client needed to know what hashing algorithm to use in order to match what the forum database was using.

For 1.16, the passwords people use to login are no longer hashed before being sent - instead the connection itself is encrypted to provide security.
:hmm:
Do I understand right that TLS-disabled 1.16 should behave like 1.14 (password should be hashed as not encrypted)?
Does the 1.16 code allow a password enabled + TLS disabled setting where the password is hashed automatically if TLS is disabled on the server.
Or there is no such a code and so it seems like all BFW1.16 password enabled servers must use TLS :(
There is no client-side password hashing functionality in 1.16, so TLS is required for password enabled servers.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
demario
Posts: 130
Joined: July 3rd, 2019, 1:05 pm

Re: Multiplayer server not connecting.

Post by demario »

Thanks for the log. It seems pretty generic and it is safe to assume other users will have a similar output (enabling log on Windows is not as straightforward as enabling an option in preferences, you need to run in a shell and passing --wconsole option).

When browsing Let's Encrypt community forum I found the following post describing a step by step fix (but not sure if the problem is same as ours). Does it make sense to anyone knowledgeable in web hosting?
While it describes a problem occurring on old client platforms, it also mentions for latest versions, "it’s totally random, on some of them it works and not on others" which matches the report of some players who can connect to the MP server occasionally but not reliably.
It gives a fix on the server that works for them for all (that's a server running on debian).
User avatar
Pentarctagon
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Multiplayer server not connecting.

Post by Pentarctagon »

demario wrote: December 22nd, 2021, 12:16 am Thanks for the log. It seems pretty generic and it is safe to assume other users will have a similar output (enabling log on Windows is not as straightforward as enabling an option in preferences, you need to run in a shell and passing --wconsole option).
I'm not sure what you mean - Windows writes output to a log file, and adding the network debug logging option should be as simple as editing the desktop shortcut or the Steam launch options.
demario wrote: December 22nd, 2021, 12:16 am When browsing Let's Encrypt community forum I found the following post describing a step by step fix (but not sure if the problem is same as ours). Does it make sense to anyone knowledgeable in web hosting?
While it describes a problem occurring on old client platforms, it also mentions for latest versions, "it’s totally random, on some of them it works and not on others" which matches the report of some players who can connect to the MP server occasionally but not reliably.
It gives a fix on the server that works for them for all (that's a server running on debian).
The MP server instance is also running Debian (not sure which version), but it doesn't use HTTP, so I don't know how applicable the solution is. Wesnoth's code for handling this is at https://github.com/wesnoth/wesnoth/blob ... _store.cpp
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Post Reply