Return the peer (i.e. the client) certificates.
This must be an SSL connection with mutual authentication;
else, null is returned.
@return the peer certificates, or null if none.
558777
public X509Certificate[] getDirectConnectionPeerCertificates()
    {
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        Class<? extends IRequest> requestClass = _request.getClass();
        X509Certificate[] certs = null;
        //PI75166
        if(checkAssignableFromIRequestImpl(requestClass)){
        
            Method method;
            try {
                method = requestClass.getMethod("getConnectionPeerCertificates", null);               
                certs = (X509Certificate[]) method.invoke(_request, null);
                
                if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME,"getDirectConnectionPeerCertificates", "this->"+this+": "+" certs value --> " + certs);
                }
                
            } catch (Exception e) {
                com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e, "com.ibm.ws.webcontainer.srt.SRTServletRequest.getDirectConnectionPeerCertificates", "635", this);
                if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
                    logger.logp(Level.FINE, CLASS_NAME,"getDirectConnectionPeerCertificates", "failed to retrieve direction connection cipher suite",e);
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME,"getDirectConnectionPeerCertificates", "this->"+this+": "+" value --> " + certs);
        }
        return certs;
    }
154861
public static ssl_cert[] get(nitro_service client) throws Exception
	{
		ssl_cert resource = new ssl_cert();
		resource.validate("get");
		return (ssl_cert[]) resource.get_resources(client);
	}
1309518
private List<SFPair<Certificate, Certificate>> getPairIssuerSubject(
      List<Certificate> bcChain)
  {
    List<SFPair<Certificate, Certificate>> pairIssuerSubject = new ArrayList<>();
    for (int i = 0, len = bcChain.size(); i < len; ++i)
    {
      Certificate bcCert = bcChain.get(i);
      if (bcCert.getIssuer().equals(bcCert.getSubject()))
      {
        continue; // skipping ROOT CA
      }
      if (i < len - 1)
      {
        pairIssuerSubject.add(SFPair.of(bcChain.get(i + 1), bcChain.get(i)));
      }
      else
      {
        synchronized (ROOT_CA_LOCK)
        {
          // no root CA certificate is attached in the certificate chain, so
          // getting one from the root CA from JVM.
          Certificate issuer = ROOT_CA.get(bcCert.getIssuer().hashCode());
          if (issuer == null)
          {
            throw new RuntimeException("Failed to find the root CA.");
          }
          pairIssuerSubject.add(SFPair.of(issuer, bcChain.get(i)));
        }
      }
    }
    return pairIssuerSubject;
  }
1050332
public java.util.List<String> getConnectIps() {
        if (connectIps == null) {
            connectIps = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return connectIps;
    }
963858
public Certificate getMatchingCert(TLSARecord tlsaRecord, List<Certificate> certs) {

        for (Certificate cert : certs) {

            byte[] digestMatch = new byte[0];
            byte[] selectorData = new byte[0];

            try {
                // Get Selector Value
                switch (tlsaRecord.getSelector()) {
                    case TLSARecord.Selector.FULL_CERTIFICATE:
                        selectorData = cert.getEncoded();
                        break;

                    case TLSARecord.Selector.SUBJECT_PUBLIC_KEY_INFO:
                        selectorData = cert.getPublicKey().getEncoded();
                        break;
                }

                // Validate Matching Type
                switch (tlsaRecord.getMatchingType()) {
                    case TLSARecord.MatchingType.EXACT:
                        digestMatch = selectorData;
                        break;
                    case TLSARecord.MatchingType.SHA256:
                        digestMatch = MessageDigest.getInstance("SHA-256").digest(selectorData);
                        break;
                    case TLSARecord.MatchingType.SHA512:
                        digestMatch = MessageDigest.getInstance("SHA-512").digest(selectorData);
                        break;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }

            if (Arrays.equals(digestMatch, tlsaRecord.getCertificateAssociationData())) {
                return cert;
            }
        }

        return null;
    }
910657
public Client getPeerClient (String nodeName)
    {
        PeerNode peer = _peers.get(nodeName);
        return (peer == null) ? null : peer.getClient();
    }
616652
public java.util.List<ClientVpnEndpoint> getClientVpnEndpoints() {
        if (clientVpnEndpoints == null) {
            clientVpnEndpoints = new com.amazonaws.internal.SdkInternalList<ClientVpnEndpoint>();
        }
        return clientVpnEndpoints;
    }
186073
private X509Certificate []getClientCertificatesImpl()
    throws CertificateException
  {
    if (! (_s instanceof SSLSocket))
      return null;
    
    SSLSocket sslSocket = (SSLSocket) _s;

    SSLSession sslSession = sslSocket.getSession();
    if (sslSession == null)
      return null;

    try {
      return (X509Certificate []) sslSession.getPeerCertificates();
    } catch (SSLPeerUnverifiedException e) {
      if (log.isLoggable(Level.FINEST))
        log.log(Level.FINEST, e.toString(), e);
      
      return null;
    } catch (Throwable e) {
      log.log(Level.FINER, e.toString(), e);
    }
    
    return null;
  }
303545
public Certificate[] getCertificates() {
        // getCodeSigners() does the sec check
        final CodeSigner[] codeSigners = getCodeSigners();
        if (codeSigners == null) {
            return null;
        }
        final List<Certificate> certList = new ArrayList<Certificate>(codeSigners.length * 3);
        for (CodeSigner signer : codeSigners) {
            certList.addAll(signer.getSignerCertPath().getCertificates());
        }
        return certList.toArray(new Certificate[certList.size()]);
    }
1308003
public java.util.List<String> getPublicIps() {
        if (publicIps == null) {
            publicIps = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return publicIps;
    }
412182
public PBKey getPBKey()
    {
        if (pbKey == null)
        {
            this.pbKey = new PBKey(this.getJcdAlias(), this.getUserName(), this.getPassWord());
        }
        return pbKey;
    }
751136
def cert_pair(self):
        
        if self._ssl_cert and self._ssl_private_key:
            return (self._ssl_cert, self._ssl_private_key)
        else:
            return None
442067
def get_certificates(self):
        """"""
        for certificate in self.user_data.certificates:
            certificate['datetime'] = certificate['datetime'].strip()

        return self.user_data.certificates
340716
private static OkHttpClient getUnsafeOkHttpClient() {
        try {
            // Create a trust manager that does not validate certificate chains
            final TrustManager[] trustAllCerts = new TrustManager[] {
                    new X509TrustManager() {
                        @Override
                        public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
                        }

                        @Override
                        public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
                        }

                        @Override
                        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                            return null;
                        }
                    }
            };

            // Install the all-trusting trust manager
            final SSLContext sslContext = SSLContext.getInstance("SSL");
            sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
            // Create an ssl socket factory with our all-trusting manager
            final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();

            OkHttpClient okHttpClient = new OkHttpClient();
            okHttpClient.setSslSocketFactory(sslSocketFactory);
            okHttpClient.setHostnameVerifier(new HostnameVerifier() {
                @Override
                public boolean verify(String hostname, SSLSession session) {
                    return true;
                }
            });

            return okHttpClient;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
324940
public static TrustManager[] getTrustManagers() throws InitializationException {
		String file = System.getProperty("javax.net.ssl.trustStore");
		String pass = System.getProperty("javax.net.ssl.trustStorePassword");

		if (file == null || pass == null) {
			throw new InitializationException("javax.net.ssl.trustStore / "
					+ "javax.net.ssl.trustStorePassword not set");
		}

		return getTrustManagers(file, pass);
	}
1220323
@Nullable
    protected final SSLSession sslSession() {
        checkState(!sessionProtocol.isTls() || sslSession != null,
                   "sslSession must be set for a TLS-enabled protocol: %s", sessionProtocol);
        return sessionProtocol.isTls() ? sslSession : null;
    }
708783
public SSLSession getSession() {
        if (this.sslConnLink != null && this.sslConnLink.getSSLEngine() != null) {
            return this.sslConnLink.getSSLEngine().getSession();
        }
        return null;
    }