Java 8 SSLException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 SSLException class.

This code example shows how to use the following methods:getCause, getMessage
     * Test for <code>DigestException(Throwable)</code> constructor Assertion: 
     * constructs DigestException when <code>cause</code> is null 
     */ 
    public void testSSLException03() { 
        Throwable cause = null;
        SSLException tE = new SSLException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>SSLException(Throwable)</code> constructor Assertion: 
     * constructs SSLException when <code>cause</code> is not null 
     */ 
    public void testSSLException04() { 
        SSLException tE = new SSLException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
            assertTrue("getMessage() should contain ".concat(toS), (getM
6
CodeRank
This code example shows how to use the following methods:
     * @param description 
     * @param reason 
     * @param cause 
     */ 
    protected void fatalAlert(byte description, String reason, Throwable cause) { 
        throw new AlertException(description, new SSLException(reason, cause)); 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
        SSLSocket ssl = (SSLSocket) socket;
        ssl.startHandshake();
 
        SSLSession session = ssl.getSession();
        if (session == null) {
            throw new SSLException("Cannot verify SSL socket without session");
        } 
        // TODO: Instead of reporting the name of the server we think we're connecting to, 
        // we should be reporting the bad name in the certificate.  Unfortunately this is buried 
        // in the verifier code and is not available in the verifier API, and extracting the 
        // CN & alts is beyond the scope of this patch. 
        if (!HOSTNAME_VERIFIER.verify(hostname, session)) {
            throw new SSLPeerUnverifiedException(
                    "Certificate hostname not useable for server: " + hostname);
        } 
    } 
 
    /** 
     * Set the socket timeout. 
     * @param timeoutMilliseconds the read timeout value if greater than {@code 0}, or 
5
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Test for <code>DigestException(Throwable)</code> constructor Assertion: 
     * constructs DigestException when <code>cause</code> is null 
     */ 
    public void testSSLException03() { 
        Throwable cause = null;
        SSLException tE = new SSLException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>SSLException(Throwable)</code> constructor Assertion: 
     * constructs SSLException when <code>cause</code> is not null 
     */ 
    public void testSSLException04() { 
        SSLException tE = new SSLException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
            assertTrue("getMessage() should contain ".concat(toS), (getM
5
CodeRank
This code example shows how to use the following methods:
     * @param description 
     * @param reason 
     * @param cause 
     */ 
    protected void fatalAlert(byte description, String reason, Throwable cause) { 
        throw new AlertException(description, new SSLException(reason, cause)); 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
     * @param description 
     * @param reason 
     * @param cause 
     */ 
    protected void fatalAlert(byte description, String reason, Throwable cause) { 
        throw new AlertException(description, new SSLException(reason, cause)); 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
    protected Object[] getData() { 
        String msg = null; 
        Exception cause = new Exception(msgs[1]); 
        SSLException excSSL = new SSLException(msgs[0]); 
        return new Object[] { new SSLException(msg), new SSLException(msgs[1]), 
                new SSLException(excSSL), new SSLException(cause), 
                new SSLException(msgs[1], cause) }; 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
     * @param description 
     * @param reason 
     * @param cause 
     */ 
    protected void fatalAlert(byte description, String reason, Throwable cause) { 
        throw new AlertException(description, new SSLException(reason, cause)); 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
clientContext = AbstractSessionContext.newInstance();
          } 
        catch (SSLException ssle)
          { 
            // XXX Ignore? 
          } 
      } 
    return clientContext;
  } 
 
  /* (non-Javadoc) 
   * @see javax.net.ssl.SSLContextSpi#engineGetServerSessionContext() 
   */ 
  protected @Override synchronized SSLSessionContext engineGetServerSessionContext()
  { 
    if (serverContext == null)
      { 
        try 
          { 
3
CodeRank
This code example shows how to use the following methods:
      { 
        throw new SSLException(iae);
      } 
    catch (InstantiationException ie)
      { 
        throw new SSLException(ie);
      } 
  } 
 
  /** 
   * Reconfigure this instance to use a different session context 
   * implementation. 
   * 
   * <p><strong>Note:</strong> this method requires that the caller have 
   * {@link SSLPermission} with target 
   * <code>gnu.javax.net.ssl.AbstractSessionContext</code> and action 
   * <code>setImplClass</code>. 
   * 
   * @param clazz The new implementation class. 
   * @throws SecurityException If the caller does not have permission to 
3
CodeRank

Related Java 8 SSLException Questions & Answers:

See Code Examples for Java 8 SSLException Methods: