docs: @Override
      public SICoreConnection createConnection(ClientConnection cc,
                                               String credentialType, String userid, String password)
                      throws SIResourceException, SINotAuthorizedException,
                      SIAuthenticationException {
  
          if (TraceComponent.isAnyTracingEnabled()
              && CoreSPIConnFactory.tc.isEntryEnabled()) {
              SibTr.entry(CoreSPIConnFactory.tc, "createConnection",
                          new Object[] { cc, credentialType, userid, password });
          }
  
          // Check that the Messaging Engine is started
          checkStarted();
  
          if ("".equals(userid))
              userid = null;
  
          SICoreConnection connection = null;
          SSLSession sslSession = cc.getMetaData().getSSLSession();
  
          if (credentialType.equals(TrmConstantsImpl.CREDENTIAL_USERID_PASSWORD)) {
              Certificate[] peerCerts = null;
              // Get hold of SSL credentials if userID null
              if (userid == null) {
                  if (sslSession != null) {
                      try {
                          // Attempt to get hold of peer certificates
                          if (TraceComponent.isAnyTracingEnabled()
                              && tc.isDebugEnabled())
                              SibTr.debug(tc,
                                          "Authentication: attempting to retrieve SSL Peer certificates");
                          peerCerts = sslSession.getPeerCertificates();
                      } catch (SSLPeerUnverifiedException sslPUE) {
                          // No FFDC Code Needed
                          // No action needed - this will be handled by the
                          // anonymous login section below
                          if (TraceComponent.isAnyTracingEnabled()
                              && tc.isDebugEnabled())
                              SibTr.debug(tc,
                                          "Authentication: Error obtaining SSL certificates >"
                                                          + sslPUE + "<");
                      }
                  }
              }
              // Call login depending on credentials provided
              if (userid != null) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc,
                                  "Authentication: Login using user ID and password");
                  connection = createConnection(userid, password, null);
              } else if ((peerCerts != null) && (peerCerts.length > 0)) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc,
                                  "Authentication: Login using SSL Peer certificates");
                  connection = createConnection(peerCerts);
              } else {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(
                                  tc,
                                  "Authentication: Anonymous Login using user ID and password; note that these may be null");
                  connection = createConnection(userid, password, null);
              }
          }
  
          //mark connection  type comms/commsssl. Explicitly porting connection to ConnectionImpl as all connection in MP are off type ConnectionImpl
          if (null != sslSession)
              ((ConnectionImpl) connection).setConnectionType(SIMPConstants.MP_VIACOMMSSSL_CONNECTION);
          else
              ((ConnectionImpl) connection).setConnectionType(SIMPConstants.MP_VIACOMMS_CONNECTION);
  
          if (TraceComponent.isAnyTracingEnabled()
              && CoreSPIConnFactory.tc.isEntryEnabled())
              SibTr.exit(CoreSPIConnFactory.tc, "createConnection", connection);
          return connection;
      }