xfifix
xfifix

Reputation: 31

Problem on Symfony Mailer with SMTP and certificate ssl not valid

Symfony version(s) affected: 4.4.3

Mailer component (not swiftmailer)

Description i try to send a mail on the SMTP server but this one don't have a certicate valid. So How to disable the ssl ?

How to reproduce the error :

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

Upvotes: 0

Views: 4013

Answers (2)

Francisco
Francisco

Reputation: 11

I solved the problem with the following code:

$transport = Transport::fromDsn('smtp://smtp://USERNAME:PASSWORD@SERVER:PORT?verify_peer=false');

in case of using gmail, you must create an app password.

I hope I helped you.

Upvotes: 1

Youssef Saoubou
Youssef Saoubou

Reputation: 591

You can disable it if you'r using swiftmailer

swiftmailer:
   stream_options:
    ssl:
        verify_peer: false
        verify_peer_name: false```

Upvotes: 1

Related Questions