Skip to content

Auto-configured JavaMailSender does not apply SSL bundle ciphers or enabled protocols - #52307

Merged
snicoll merged 1 commit into
spring-projects:4.0.xfrom
padosol:mail-ssl-bundle-options
Oct 26, 2026
Merged

snicoll merged 1 commit into
spring-projects:4.0.xfrom
padosol:mail-ssl-bundle-options

Conversation

@padosol

@padosol padosol commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Problem

When an SSL bundle is configured using spring.mail.ssl.bundle, the bundle's options (ciphers and enabled-protocols) are not applied.

spring:
  mail:
    host: smtp.example.com
    ssl:
      bundle: mail
  ssl:
    bundle:
      jks:
        mail:
          truststore:
            location: classpath:truststore.p12
            password: secret
          options:
            enabled-protocols: TLSv1.3
            ciphers: TLS_AES_128_GCM_SHA256

Expected

mail.smtp.ssl.checkserveridentity=true
mail.smtp.ssl.socketFactory=<SSLSocketFactory>
mail.smtp.ssl.protocols=TLSv1.3
mail.smtp.ssl.ciphersuites=TLS_AES_128_GCM_SHA256

Actual

mail.smtp.ssl.checkserveridentity=true
mail.smtp.ssl.socketFactory=<SSLSocketFactory>

Cause

MailSenderPropertiesConfiguration only passes on the bundle's SSLSocketFactory and does not use SslBundle.getOptions(). Angus Mail only restricts the protocols and ciphers through the mail.<protocol>.ssl.protocols and mail.<protocol>.ssl.ciphersuites properties, so the bundle's options are not applied.

Redis already applies the bundle's options: Jedis, Lettuce

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Oct 20, 2026
@snicoll snicoll self-assigned this Oct 26, 2026
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Oct 26, 2026
@snicoll snicoll added this to the 4.0.10 milestone Oct 26, 2026
@snicoll
snicoll force-pushed the mail-ssl-bundle-options branch from 0cce518 to a0ea57b Compare October 26, 2026 10:01
@snicoll
snicoll merged commit 64159c8 into spring-projects:4.0.x Oct 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants