client disconnects immediately after TLS handshake — SessionManager.Initialize() never called #4

Open
opened 2026-03-27 21:42:31 +02:00 by iAdrian · 0 comments
Owner

Problem

D3 client connects on port 1119, TLS handshake succeeds, but disconnects immediately after AuthenticationService is reached. No login form is shown.

Info | Connect with Blizzless established. Client - [::ffff:172.18.0.1]:45966 Info | Game: Diablo 3 | Version: 84161 | Platform: Wn64 | Locale: enUS Info | Client - [::ffff:172.18.0.1]:45966, disconnected

Root Cause

SessionManager.Instance.Initialize() is never called in Program.cs.

Consequences:

  1. REST /battlenet/login returns {"inputs":[]} → D3 shows no login form
  2. Auth flow has no active session → server disconnects client immediately

Secondary Issue

SessionManager.Initialize() loads BNetServer.pfx which doesn't exist in
the container (or in a standard checkout), causing a crash if called naively:

BIO_new_file() called on non-existent file "BNetServer.pfx"

The certificate is only used for HTTPS — the REST server runs HTTP, so the
cert is not actually needed. The load should be wrapped in a try-catch.

Fix (maybe)

src/DiIiS-NA/Program.cs — call Initialize() before REST server starts:

SessionManager.Instance.Initialize();
var restSocketServer = new SocketManager<RestSession>();

src/DiIiS-NA/REST/Manager/SessionManager.cs  make cert load optional:

try { _certificate = new X509Certificate2("BNetServer.pfx"); }
catch { /* cert file is optional — REST runs over HTTP */ }

Impact

Without this fix, authentication always fails silently. This is reproducible on any fresh Docker setup or clean checkout.
## Problem D3 client connects on port 1119, TLS handshake succeeds, but disconnects immediately after `AuthenticationService` is reached. No login form is shown. Info | Connect with Blizzless established. Client - [::ffff:172.18.0.1]:45966 Info | Game: Diablo 3 | Version: 84161 | Platform: Wn64 | Locale: enUS Info | Client - [::ffff:172.18.0.1]:45966, disconnected ## Root Cause `SessionManager.Instance.Initialize()` is never called in `Program.cs`. Consequences: 1. REST `/battlenet/login` returns `{"inputs":[]}` → D3 shows no login form 2. Auth flow has no active session → server disconnects client immediately ## Secondary Issue `SessionManager.Initialize()` loads `BNetServer.pfx` which doesn't exist in the container (or in a standard checkout), causing a crash if called naively: BIO_new_file() called on non-existent file "BNetServer.pfx" The certificate is only used for HTTPS — the REST server runs HTTP, so the cert is not actually needed. The load should be wrapped in a try-catch. ## Fix (maybe) **`src/DiIiS-NA/Program.cs`** — call Initialize() before REST server starts: ```csharp SessionManager.Instance.Initialize(); var restSocketServer = new SocketManager<RestSession>(); src/DiIiS-NA/REST/Manager/SessionManager.cs — make cert load optional: try { _certificate = new X509Certificate2("BNetServer.pfx"); } catch { /* cert file is optional — REST runs over HTTP */ } Impact Without this fix, authentication always fails silently. This is reproducible on any fresh Docker setup or clean checkout.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gaming/blizzless-diiis#4
No description provided.