TlsStream.handshake

TlsProgress handshake()

Performs or continues the TLS handshake.

Call repeatedly until TlsProgress.DONE is returned. On NEED_READ, wait for transport readability and call again. On NEED_WRITE, wait for transport writability and call again.

Returns

TlsProgress.DONE when complete, NEED_READ or

NEED_WRITE when I/O is required, ERROR on failure.

Throws

TlsCertificateException if certificate verification fails.