From 68b6fb5d9bc2cbafac7deb0c81819c0227cf413c Mon Sep 17 00:00:00 2001 From: Grant Birchmeier Date: Tue, 31 Dec 2024 12:20:58 -0600 Subject: [PATCH] fix a possible-null warning accidentally introduced in PR #917, somehow I overlooked the warning --- QuickFIXn/Transport/StreamFactory.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/QuickFIXn/Transport/StreamFactory.cs b/QuickFIXn/Transport/StreamFactory.cs index 4bc22d03d..89bdd5765 100644 --- a/QuickFIXn/Transport/StreamFactory.cs +++ b/QuickFIXn/Transport/StreamFactory.cs @@ -72,6 +72,10 @@ internal static Stream CreateClientStream(IPEndPoint endpoint, SocketSettings se if (!settings.SocketIgnoreProxy) { + if (settings.ServerCommonName is null) { + throw new ConfigError( + $"{SessionSettings.SOCKET_IGNORE_PROXY}=Y needs {SessionSettings.SSL_SERVERNAME} to be set"); + } // If system has configured a proxy for this config, use it. socket = CreateTunnelThruProxy(endpoint.Address.ToString(), endpoint.Port, settings.ServerCommonName); }