forked from https://github.com/symfony/symfony
7bdeff0f84
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Simplify the way TLS/SSL/STARTTLS work
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | yes
| BC breaks? | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | -
The way TLS/SSL/STARTTLS is handled is not easy to understand. It's inherited from Swiftmailer and today, I've spent some time to see if we could improve it.
First, the current way: `setEncryption()` takes a string, either `ssl` or `tls`:
* `ssl`: to enable TLS support on the connection
* `tls`: to enable `STARTTLS` (upgrade the connection)
There is also a `isTLS()` method which is really confusing due to the fact that both configuration are about TLS anyway.
So, this PR changes things radically:
* The `setEncryption` method and the `encryption` option on the DSN are gone.
* TLS is used by default and you can disable it via `disableTls()`. Being secure by default is probably a good idea anyway (like using HTTPS by default instead of HTTP).
* A new "protocol" SMTPS is supported now and is a way to say that you want TLS; so use `smtps://localhost` to set TLS instead of `smtp://localhost?encryption=ssl`. Note that using `smtp://localhost:465` does the same. All third-party providers now supports both `smtp` and `smtps` protocol even if that does the exact same thing for them (TLS is always enabled).
* The port is automatically determined based on the TLS setting (if not set explicitly). So 465 for TLS and falls back to 25.
* There is no more way to enable `STARTTLS`. If you don't configure TLS on the connection and if the server supports `STARTTLS`, then we will enable it automatically.
Great document about all of this: https://www.fastmail.com/help/technical/ssltlsstarttls.html
Commits
-------
|
||
---|---|---|
.composer | ||
.github | ||
src/Symfony | ||
.appveyor.yml | ||
.editorconfig | ||
.gitignore | ||
.php_cs.dist | ||
.travis.yml | ||
CHANGELOG-4.0.md | ||
CHANGELOG-4.1.md | ||
CHANGELOG-4.2.md | ||
CHANGELOG-4.3.md | ||
CODE_OF_CONDUCT.md | ||
composer.json | ||
CONTRIBUTING.md | ||
CONTRIBUTORS.md | ||
LICENSE | ||
link | ||
phpunit | ||
phpunit.xml.dist | ||
README.md | ||
UPGRADE-4.0.md | ||
UPGRADE-4.1.md | ||
UPGRADE-4.2.md | ||
UPGRADE-4.3.md | ||
UPGRADE-4.4.md | ||
UPGRADE-5.0.md |
Symfony is a PHP framework for web applications and a set of reusable PHP components. Symfony is used by thousands of web applications (including BlaBlaCar.com and Spotify.com) and most of the popular PHP projects (including Drupal and Magento).
Installation
- Install Symfony with Composer (see requirements details).
- Symfony follows the semantic versioning strictly, publishes "Long Term Support" (LTS) versions and has a release process that is predictable and business-friendly.
Documentation
- Read the Getting Started guide if you are new to Symfony.
- Try the Symfony Demo application to learn Symfony in practice.
- Master Symfony with the Guides and Tutorials, the Components docs and the Best Practices reference.
Community
- Join the Symfony Community and meet other members at the Symfony events.
- Get Symfony support on Stack Overflow, Slack, IRC, etc.
- Follow us on GitHub, Twitter and Facebook.
- Read our Code of Conduct and meet the CARE Team
Contributing
Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.
Security Issues
If you discover a security vulnerability within Symfony, please follow our disclosure procedure.
About Us
Symfony development is sponsored by SensioLabs, led by the Symfony Core Team and supported by Symfony contributors.