laravel-sendgrid-driver icon indicating copy to clipboard operation
laravel-sendgrid-driver copied to clipboard

cURL error 56

Open mityukov opened this issue 4 years ago • 0 comments

From time to time, I get this error when trying to send email:

cURL error 56: OpenSSL SSL_read: error:140943FC:SSL routines:ssl3_read_bytes:sslv3 alert bad record mac, errno 0 (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

(laravel 7, php 7.3, guzzlehttp v6)

From what I found on the Internet, this could be related to reused connections, so I went on and added 'guzzle' subsection to config:services.sendgrid:

// services.php
<?php

return [

 // ...

 'sendgrid' => [
        'api_key' => env('SENDGRID_API_KEY'),

        'guzzle' => [
            'headers' => ['Connection' => 'close'],
            CURLOPT_FORBID_REUSE => true,
            CURLOPT_FRESH_CONNECT => true,
        ],
    ],

  // ...
];

But, probably, this should be made default or, at least, suggested on the readme.

mityukov avatar Jan 07 '21 07:01 mityukov