/** * Because there are so many connect() methods, * the _connectAction_() method is provided as a means of performing * some action immediately after establishing a connection, * rather than reimplementing all of the connect() methods. * @throws IOException If it is thrown by _connectAction_(). * @see org.apache.commons.net.SocketClient#_connectAction_() */ @Override protected void _connectAction_() throws IOException { // Implicit mode. if (isImplicit) { performSSLNegotiation(); } super._connectAction_(); // Explicit mode - don't do anything. The user calls execTLS() }
/** * The TLS command execution. * @throws IOException If an I/O error occurs while sending * the command or performing the negotiation. * @return TRUE if the command and negotiation succeeded. */ public boolean execTLS() throws IOException { if (!SMTPReply.isPositiveCompletion(sendCommand("STARTTLS"))) { return false; //throw new SSLException(getReplyString()); } performSSLNegotiation(); return true; }