/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @return the next action that should be taken by the handshake */ private PhaseType write() throws IOException { return write(5); }
/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @return the next action that should be taken by the handshake */ private Status write() throws IOException { return write(5); }
/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @return the next action that should be taken by the handshake */ private PhaseType write() throws IOException { return write(5); }
/** * This is the main point of execution within the negotiation. It * is where the negotiation is performed. Negotiations are done * by performing a request response flow, governed by the SSL * engine associated with the transport. Typically the client is * the one to initiate the handshake and the server initiates the * termination sequence. This may be executed several times * depending on whether reading or writing blocks. * * @return this returns what is expected next in the negotiation */ private PhaseType exchange() throws IOException { HandshakeStatus status = engine.getHandshakeStatus(); switch(status){ case NEED_WRAP: return write(); case NOT_HANDSHAKING: case NEED_UNWRAP: return read(); } return COMMIT; }
/** * This is the main point of execution within the negotiation. It * is where the negotiation is performed. Negotiations are done * by performing a request response flow, governed by the SSL * engine associated with the transport. Typically the client is * the one to initiate the handshake and the server initiates the * termination sequence. This may be executed several times * depending on whether reading or writing blocks. * * @return this returns what is expected next in the negotiation */ private Status exchange() throws IOException { HandshakeStatus status = engine.getHandshakeStatus(); switch(status){ case NEED_WRAP: return write(); case NOT_HANDSHAKING: case NEED_UNWRAP: return read(); } return COMMIT; }
/** * This is the main point of execution within the negotiation. It * is where the negotiation is performed. Negotiations are done * by performing a request response flow, governed by the SSL * engine associated with the transport. Typically the client is * the one to initiate the handshake and the server initiates the * termination sequence. This may be executed several times * depending on whether reading or writing blocks. * * @return this returns what is expected next in the negotiation */ private PhaseType exchange() throws IOException { HandshakeStatus status = engine.getHandshakeStatus(); switch(status){ case NEED_WRAP: return write(); case NOT_HANDSHAKING: case NEED_UNWRAP: return read(); } return COMMIT; }
/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @param count this is the number of times a read can repeat * * @return the next action that should be taken by the handshake */ private PhaseType write(int count) throws IOException { while(count > 0) { SSLEngineResult result = engine.wrap(empty, output); HandshakeStatus status = result.getHandshakeStatus(); switch(status) { case NOT_HANDSHAKING: case FINISHED: case NEED_UNWRAP: return PRODUCE; case NEED_WRAP: return write(count-1); case NEED_TASK: execute(); } } return PRODUCE; }
/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @param count this is the number of times a read can repeat * * @return the next action that should be taken by the handshake */ private Status write(int count) throws IOException { while(count > 0) { SSLEngineResult result = engine.wrap(empty, output); HandshakeStatus status = result.getHandshakeStatus(); switch(status) { case NOT_HANDSHAKING: case FINISHED: case NEED_UNWRAP: return PRODUCE; case NEED_WRAP: return write(count-1); case NEED_TASK: execute(); } } return PRODUCE; }
/** * This is used to perform the write part of the negotiation. The * read part is where the this sends information to the other side * and the other side interprets the data and determines what action * to take. After a write the negotiation typically completes or * waits for the next response from the other side. * * @param count this is the number of times a read can repeat * * @return the next action that should be taken by the handshake */ private PhaseType write(int count) throws IOException { while(count > 0) { SSLEngineResult result = engine.wrap(empty, output); HandshakeStatus status = result.getHandshakeStatus(); switch(status) { case NOT_HANDSHAKING: case FINISHED: case NEED_UNWRAP: return PRODUCE; case NEED_WRAP: return write(count-1); case NEED_TASK: execute(); } } return PRODUCE; }