3030import quickfix .DefaultSessionFactory ;
3131import quickfix .FieldConvertError ;
3232import quickfix .LogFactory ;
33+ import quickfix .LogUtil ;
3334import quickfix .MessageFactory ;
3435import quickfix .MessageStoreFactory ;
3536import quickfix .RuntimeError ;
@@ -117,6 +118,7 @@ protected synchronized void startAcceptingConnections() throws ConfigError {
117118 ioAcceptor .bind (socketDescriptor .getAddress ());
118119 log .info ("Listening for connections at {} for session(s) {}" , address , socketDescriptor .getAcceptedSessions ().keySet ());
119120 } catch (IOException | GeneralSecurityException | ConfigError e ) {
121+ // we cannot log for a specific session here
120122 if (continueInitOnError ) {
121123 log .warn ("error during session initialization for session(s) {}, continuing..." , socketDescriptor .getAcceptedSessions ().keySet (), e );
122124 } else {
@@ -183,8 +185,6 @@ && getSettings().getBool(sessionID, SSLSupport.SETTING_USE_SSL)) {
183185 if (acceptTransportType == ProtocolFactory .SOCKET ) {
184186 useSSL = true ;
185187 sslConfig = SSLSupport .getSslConfig (getSettings (), sessionID );
186- } else {
187- log .warn ("SSL will not be enabled for transport type={}, session={}" , acceptTransportType , sessionID );
188188 }
189189 }
190190
@@ -214,6 +214,11 @@ && getSettings().getBool(sessionID, SSLSupport.SETTING_USE_SSL)) {
214214 descriptor .acceptSession (session );
215215 allSessions .put (sessionID , session );
216216 }
217+
218+ if (acceptTransportType != ProtocolFactory .SOCKET
219+ && getSettings ().getBoolOrDefault (sessionID , SSLSupport .SETTING_USE_SSL , false )) {
220+ LogUtil .logWarning (sessionID , "SSL is only supported for transport type SOCKET and will not be enabled for transport type=" + acceptTransportType );
221+ }
217222 }
218223
219224 private boolean equals (Object object1 , Object object2 ) {
@@ -245,7 +250,7 @@ private void createSessions(SessionSettings settings, boolean continueInitOnErro
245250 }
246251 } catch (Throwable t ) {
247252 if (continueInitOnError ) {
248- log . warn ( "error during session initialization for {} , continuing..." , sessionID , t );
253+ LogUtil . logWarning ( sessionID , "error during session initialization, continuing..." , t );
249254 } else {
250255 throw t instanceof ConfigError ? (ConfigError ) t : new ConfigError (
251256 "error during session initialization" , t );
@@ -329,6 +334,7 @@ public StaticAcceptorSessionProvider(final Map<SessionID, Session> acceptorSessi
329334 this .acceptorSessions = acceptorSessions ;
330335 }
331336
337+ @ Override
332338 public Session getSession (SessionID sessionID , SessionConnector connector ) {
333339 return acceptorSessions .get (sessionID );
334340 }
@@ -349,6 +355,7 @@ public DefaultAcceptorSessionProvider(Map<SessionID, Session> acceptorSessions)
349355 this .acceptorSessions = acceptorSessions ;
350356 }
351357
358+ @ Override
352359 public Session getSession (SessionID sessionID , SessionConnector ignored ) {
353360 Session session = acceptorSessions .get (sessionID );
354361 if (session == null ) {
0 commit comments