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); }