docs: @Override
      public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "checkServerTrusted");
  
          Map<String, Object> currentConnectionInfo = ThreadManager.getInstance().getOutboundConnectionInfoInternal();
          if (currentConnectionInfo != null) {
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "original peerHost: " + peerHost);
                  Tr.debug(tc, "currentConnectionInfo: " + currentConnectionInfo);
              }
              peerHost = (String) currentConnectionInfo.get(Constants.CONNECTION_INFO_REMOTE_HOST);
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  Tr.debug(tc, "current peerHost: " + peerHost);
          } else {
              currentConnectionInfo = extendedInfo;
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  Tr.debug(tc, "currentConnectionInfo from extendedInfo: " + currentConnectionInfo);
          }
  
          extendedInfo = JSSEHelper.getInstance().getOutboundConnectionInfo();
          if (extendedInfo != null)
              peerHost = (String) extendedInfo.get(Constants.CONNECTION_INFO_REMOTE_HOST);
  
          // if we do not have host and port just go ahead and default it to unknown
          // to avoid null's
          if (peerHost == null || 0 == peerHost.length()) {
              peerHost = "unknown";
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Target host: " + peerHost);
              for (int j = 0; j < chain.length; j++) {
                  Tr.debug(tc, "Certificate information:");
                  Tr.debug(tc, "  Subject DN: " + chain[j].getSubjectDN());
                  Tr.debug(tc, "  Issuer DN: " + chain[j].getIssuerDN());
                  Tr.debug(tc, "  Serial number: " + chain[j].getSerialNumber());
              }
          }
  
          for (int i = 0; i < tm.length; i++) {
              if (tm[i] != null && tm[i] instanceof X509TrustManager) {
                  // skip the default trust manager if configured to do so.
                  try {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(tc, "Delegating to X509TrustManager: " + tm[i].getClass().getName());
                      ((X509TrustManager) tm[i]).checkServerTrusted(chain, authType);
                  } catch (CertificateException e) {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(tc, "Certificate Exception occurred: " + e.getMessage());
  
                      // if the reason for the CertificateException is due to
                      // an expired date, don't accept it.
                      boolean dateValid = checkIfExpiredBeforeOrAfter(chain);
                      if (!dateValid) {
                          throw e;
                      }
  
                      try {
                          // If this is a client process then we may prompt the user to accept the signer certificate
                          if (!isServer) {
                              if (!autoAccept) {
                                  // prompt user
                                  if (userAcceptedPrompt(chain)) {
                                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                          Tr.debug(tc, "prompt user - adding certificate to the truststore.");
                                      setCertificateToTruststore(chain);
                                  } else {
                                      printClientHandshakeError(config, tsFile, e, chain);
                                      throw e;
                                  }
  
                              } else {
                                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                      Tr.debug(tc, "autoacceptsigner - adding certificate to the truststore.");
                                  setCertificateToTruststore(chain);
                              }
                          } else {
                              // IBM JDK will throw the exception in obfuscated code, get the cause
                              Exception excpt = e;
                              if (excpt.getClass().toString().startsWith("class com.ibm.jsse2")) {
                                  excpt = (Exception) excpt.getCause();
                              }
  
                              // This the server print a message and rethrow the exception
                              FFDCFilter.processException(excpt, getClass().getName(), "checkServerTrusted", this, new Object[] { chain, authType });
                              printClientHandshakeError(config, tsFile, e, chain);
                              throw excpt;
                          }
                      } catch (Exception ex)
                      {
                          throw new CertificateException(ex.getMessage());
                      }
                  }
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              Tr.debug(tc, "Server is trusted by all X509TrustManagers.");
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "checkServerTrusted");
      }