Package javax.net.ssl

Examples of javax.net.ssl.SSLException


                FTPSCommand._commands[FTPSCommand.AUTH], auth);
        if (FTPReply.SECURITY_MECHANISM_IS_OK == replyCode) {
            // replyCode = 334
            // I carry out an ADAT command.
        } else if (FTPReply.SECURITY_DATA_EXCHANGE_COMPLETE != replyCode) {
            throw new SSLException(getReplyString());
        }
    }
View Full Code Here


    public void execPBSZ(long pbsz) throws SSLException, IOException {
        if (pbsz < 0 || 4294967295L < pbsz)
            throw new IllegalArgumentException();
        if (FTPReply.COMMAND_OK != sendCommand(
                FTPSCommand._commands[FTPSCommand.PBSZ],String.valueOf(pbsz)))
            throw new SSLException(getReplyString());
    }
View Full Code Here

    public void execPROT(String prot) throws SSLException, IOException {
        if (prot == null) prot = DEFAULT_PROT;
        if (!checkPROTValue(prot)) throw new IllegalArgumentException();
        if (FTPReply.COMMAND_OK != sendCommand(
                FTPSCommand._commands[FTPSCommand.PROT], prot))
            throw new SSLException(getReplyString());
        if (DEFAULT_PROT.equals(prot)) {
            setSocketFactory(null);
            setServerSocketFactory(null);
        } else {
            setSocketFactory(new FTPSSocketFactory(context));
View Full Code Here

            if (FTPReply.COMMAND_OK == repCode) {
                    // TODO Check this - is this necessary at all?
                _socket_ = planeSocket;
                setSocketFactory(null);
            } else {
                throw new SSLException(getReplyString());
            }
        }
        return repCode;
    }
View Full Code Here

                sslv2 = false;
            }

            if (!sslv2) {
                // Bad data - discard the buffer and raise an exception.
                SSLException e = new SSLException(
                        "not an SSL/TLS record: " + ChannelBuffers.hexDump(buffer));
                buffer.skipBytes(buffer.readableBytes());
                throw e;
            }
        }
View Full Code Here

            // Renegotiate.
            handshake();
        } else {
            // Raise an exception.
            fireExceptionCaught(
                    ctx, new SSLException(
                            "renegotiation attempted by peer; " +
                            "closing the connection"));

            // Close the connection to stop renegotiation.
            Channels.close(ctx, succeededFuture(ctx.getChannel()));
View Full Code Here

                  return null;
               }
            }
            else
            {
               handshakeFuture.setFailure(new SSLException("Handshake was not completed in 30 seconds"));
               ch.close().awaitUninterruptibly();
               return null;
            }

         }
View Full Code Here

                                    buf);
                        }
                    }
                } catch (SSLException ssle) {
                    if (!handler.isInitialHandshakeComplete()) {
                        SSLException newSSLE = new SSLHandshakeException(
                                "Initial SSL handshake failed.");
                        newSSLE.initCause(ssle);
                        ssle = newSSLE;
                    }

                    throw ssle;
                }
View Full Code Here

            if (result.getStatus() == SSLEngineResult.Status.OK) {
                if (result.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_TASK) {
                    doTasks();
                }
            } else {
                throw new SSLException("SSLEngine error during encrypt: "
                        + result.getStatus() + " src: " + src
                        + "outNetBuffer: " + outNetBuffer);
            }
        }
View Full Code Here

        // By RFC 2616, we can "fire and forget" our close_notify
        // message, so that's what we'll do here.
        outNetBuffer.clear();
        SSLEngineResult result = sslEngine.wrap(hsBB, outNetBuffer);
        if (result.getStatus() != SSLEngineResult.Status.CLOSED) {
            throw new SSLException("Improper close state: " + result);
        }
        outNetBuffer.flip();
        return true;
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLException

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.