vertx-mail-client icon indicating copy to clipboard operation
vertx-mail-client copied to clipboard

Block bug for TLS?

Open snpcp opened this issue 1 year ago • 5 comments

Code: ... MailConfig { host: xxx; port: xxx; ssl: false; connect timeout: 3000ms read timeout : 3000ms write timeout: 3000ms idle timeout: 6000ms } Use tls port, but use setSsl(false), No event of ofFail() and thread blocked.

Version: vertx-core & vertx-mail-client 4.3.5 OS: MAC

snpcp avatar May 18 '23 14:05 snpcp

the port is 465. it's TLS port, but not use setStarttls and setSsl.

snpcp avatar May 18 '23 14:05 snpcp

@snpcp will it work for you if calling setSsl(true) ?

gaol avatar May 18 '23 14:05 gaol

yes, setSsl -> true, I see socket close ex.... it's normal. I hope see exception, because port is TLS, but not handshake. so it must be ofFail.

snpcp avatar May 18 '23 14:05 snpcp

above all, don't block for anytime.

snpcp avatar May 18 '23 14:05 snpcp

Look like not set SMTPConnection.errorHandler.

  1. connect fail -> set errorHandler
  2. read message -> set errorHandler
  3. connect success & not handshake & close connect -> not set errorHandler
private void handleError(Throwable t) {
    context.emit(t, err -> {
      Handler<Throwable> handler;
      synchronized (SMTPConnection.this) {
        handler = errorHandler;
      }
      if (handler != null) {
        handler.handle(err);
      } else {
        if (log.isDebugEnabled()) {
          log.debug(t.getMessage(), t);
        }
      }
    });
  } 

snpcp avatar May 18 '23 14:05 snpcp