Skip to content

Upgrade to PHP 8.1#14

Merged
vortrixs merged 9 commits intomasterfrom
upgrade-php-81
Aug 24, 2022
Merged

Upgrade to PHP 8.1#14
vortrixs merged 9 commits intomasterfrom
upgrade-php-81

Conversation

@vortrixs
Copy link
Contributor

@vortrixs vortrixs commented Aug 22, 2022

  • Updated PHP requirements to >=8.0
  • Updated Codeception to ^5
  • SecureSocketCest::sendSMTPMessageOverSecureSocket has been re-enabled since it is actually functional and passes with the right setup [1]

[1] For the test to pass the SMTP server needs to have a SSL certificate installed and the certificate also needs to be added into the client's trusted CA store ("client" in this case being the system PHP runs on). As such I've added a "stop gap" that skips the test if the connection fails.

This is might not be the best way, but it's tricky finding a clean solution because we are dealing with two types of failure here:

  • First is if the server does not have TLS support, this will generally fail with a "command does not exist" error referencing the STARTTLS command send by our code. (Tested using smtp-sink which we use on Travis)
  • Second is if the server does have a SSL certificate, but the client doesn't trust it, in my case this produced a valid response from the server, but with an unexpected status code resulting in our code throwing an exception for "unexpected response", with the actual response just being garbled characters (I assume this is because the server still encrypts the data). (Tested using smtp4dev)

Long story short, I was able to make it pass by integrating https://github.com/rnwood/smtp4dev into my docker setup and doing some "openssl magic", but I'm not sure how easy it is to replicate in the test environment.

@vortrixs vortrixs self-assigned this Aug 22, 2022
@vortrixs vortrixs merged commit 92f2ce0 into master Aug 24, 2022
@vortrixs vortrixs deleted the upgrade-php-81 branch August 25, 2022 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants