Closed danielabeledo closed 6 months ago
Hi, it seems you are wrapping the creation of the SSLSocket with a try-with-resources.
https://github.com/gessnerfl/fake-smtp-server/blob/main/src/main/java/de/gessnerfl/fakesmtp/smtp/command/StartTLSCommand.java#L42
SSLSocketImpl implements Autocloseable so the TLS socket closes before the STARTTLS command finishes
How to reproduce Java version 21
Running application with self-signed certificate
openssl s_client -starttls smtp -connect <HOST:PORT> -crlf -CAfile certificate.pem
Remediation
Running the application without wrapping the socket creation with try-with-resources solves the issue
@danielabeledo you are right. Issue is fixed with version 2.2.0
Can you please cross check and reopen if the issue persists
Yeah, looks fine to me now - thanks for the quick turnaround
Hi, it seems you are wrapping the creation of the SSLSocket with a try-with-resources.
https://github.com/gessnerfl/fake-smtp-server/blob/main/src/main/java/de/gessnerfl/fakesmtp/smtp/command/StartTLSCommand.java#L42
SSLSocketImpl implements Autocloseable so the TLS socket closes before the STARTTLS command finishes
How to reproduce Java version 21
Running application with self-signed certificate
openssl s_client -starttls smtp -connect <HOST:PORT> -crlf -CAfile certificate.pem
Remediation
Running the application without wrapping the socket creation with try-with-resources solves the issue