Package javax.net.ssl

Examples of javax.net.ssl.X509TrustManager


      context = SSLContext.getInstance(protocol);
      kmf = KeyManagerFactory.getInstance(kmfFactory);
      ks = KeyStore.getInstance(keyStoreType);
      ks.load(new FileInputStream(keyStore), passphrase);

      TrustManager tm = (this.tm != null) ? this.tm : new X509TrustManager() {
        public void checkClientTrusted(X509Certificate[] arg0, String arg1)
          throws CertificateException {}
        public void checkServerTrusted(X509Certificate[] arg0, String arg1)
          throws CertificateException {}
        public X509Certificate[] getAcceptedIssuers() {
View Full Code Here


    {
      sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    }
    else
    {
      TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager()
      {
        public java.security.cert.X509Certificate[] getAcceptedIssuers()
        {
          return null;
        }
View Full Code Here

    protected SSLContext getLooseSSLContext() throws IOException
    {

        // Create a trust manager that does not validate certificate
        // chains
        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager()
        {
            public java.security.cert.X509Certificate[] getAcceptedIssuers()
            {
                return null;
            }
View Full Code Here

      throw new IllegalStateException(e);
    }
    TrustManager[] managers = factory.getTrustManagers();

    // there is only one trust manager for the SSL root certs
    X509TrustManager manager = (X509TrustManager) managers[0];

    this.roots = Lists.newArrayList(manager.getAcceptedIssuers());

    try {
      CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
      this.roots.add((X509Certificate) certFactory.generateCertificate(
          new ByteArrayInputStream(STARTCOM_CA.getBytes())));
View Full Code Here

    {
        if ( m_aSSLContext == null )
        {
            TrustManager[] pTrustUnknownCerts = new TrustManager[]
            {
                new X509TrustManager() {
                    private X509TrustManager m_aOrgTrustManager;
               
                    private X509TrustManager GetOrgTrustManager()
                    {
                        if ( m_aOrgTrustManager == null )
View Full Code Here

                fullUrl += bnvp.getName() + "=" + uriEncode(bnvp.getValue()) + "&";
            }
        }

        TrustManager[] trustAllCerts = new TrustManager[]{
                new X509TrustManager() {
                    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                        return null;
                    }

                    public void checkClientTrusted(
View Full Code Here

    private boolean useTimestamp = false;
    private boolean skipExisting = false;

    public HttpDownloader() {

        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
            public java.security.cert.X509Certificate[] getAcceptedIssuers() {
                return null;
            }

            public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
View Full Code Here

    public void checkServerTrusted( X509Certificate[] chain, String authType ) throws CertificateException
    {
        // check permanent trusted certificates, return on success
        try
        {
            X509TrustManager permanentTrustManager = getPermanentTrustManager();
            if ( permanentTrustManager != null )
            {
                permanentTrustManager.checkServerTrusted( chain, authType );
                return;
            }
        }
        catch ( CertificateException ce )
        {
        }

        // check temporary trusted certificates, return on success
        try
        {
            X509TrustManager sessionTrustManager = getSessionTrustManager();
            if ( sessionTrustManager != null )
            {
                sessionTrustManager.checkServerTrusted( chain, authType );
                return;
            }
        }
        catch ( CertificateException ce )
        {
View Full Code Here

     * @throws CertificateException the certificate exception
     */
    private X509TrustManager getPermanentTrustManager() throws CertificateException
    {
        KeyStore permanentTrustStore = ConnectionCorePlugin.getDefault().getPermanentTrustStoreManager().getKeyStore();
        X509TrustManager permanentTrustManager = getTrustManager( permanentTrustStore );
        return permanentTrustManager;
    }
View Full Code Here

     * @throws CertificateException the certificate exception
     */
    private X509TrustManager getSessionTrustManager() throws CertificateException
    {
        KeyStore sessionTrustStore = ConnectionCorePlugin.getDefault().getSessionTrustStoreManager().getKeyStore();
        X509TrustManager sessionTrustManager = getTrustManager( sessionTrustStore );
        return sessionTrustManager;
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.X509TrustManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.