Git Product home page Git Product logo

Comments (9)

ausi avatar ausi commented on August 24, 2024

error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version looks like SSL problems on your server.

Does the following code work on your server?

$url = 'https://cdn.onebauer.media/one/empire-images/features/5665a94d329ff0ca7c62aca1/STA039DV.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit';
var_dump(strlen(file_get_contents($url));

from imagine.

jetibbetts avatar jetibbetts commented on August 24, 2024

Yes

int(90316)

from imagine.

ausi avatar ausi commented on August 24, 2024

But the following code fails?

$url = 'https://cdn.onebauer.media/one/empire-images/features/5665a94d329ff0ca7c62aca1/STA039DV.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit';
var_dump(strlen((new Imagine\File\Loader($url))->getData()));

Then it is probably CURL related, please also test the following code:

$url = 'https://cdn.onebauer.media/one/empire-images/features/5665a94d329ff0ca7c62aca1/STA039DV.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSLVERSION, 5);
var_dump(strlen(curl_exec($curl)));

from imagine.

jetibbetts avatar jetibbetts commented on August 24, 2024

The first code does indeed fail with the same original error.

The results of the CURL code is: int(0)

from imagine.

ausi avatar ausi commented on August 24, 2024

The results of the CURL code is: int(0)

int(0) means that CURL was not able to load the data.
With the following test code you should get an error message printend too.

$url = 'https://cdn.onebauer.media/one/empire-images/features/5665a94d329ff0ca7c62aca1/STA039DV.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSLVERSION, 5);
var_dump(strlen(curl_exec($curl)));
var_dump(curl_errno($curl));
var_dump(curl_error($curl));

from imagine.

jetibbetts avatar jetibbetts commented on August 24, 2024

It's the original curl error:

int(0) int(35) string(72) "error:1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version"

from imagine.

ausi avatar ausi commented on August 24, 2024

Then you need to fix the CURL setup on your server I think.

You can also disable CURL for PHP, then Imagine would fallback to file_get_contents() automatically.

from imagine.

ArniPL avatar ArniPL commented on August 24, 2024

We have the same problem. It looks like the curl_setopt($curl, CURLOPT_SSLVERSION, 5); is the issue here. Now Imagine can't open remote images from servers that disabled TLS 1.1.

Why does Imagine force curl to use the deprecated TLS 1.1 version? Shouldn't this be negotiated automatically, as it is by default? Thanks!

from imagine.

radli avatar radli commented on August 24, 2024

We have the same problem. It looks like the curl_setopt($curl, CURLOPT_SSLVERSION, 5); is the issue here. Now Imagine can't open remote images from servers that disabled TLS 1.1.

Why does Imagine force curl to use the deprecated TLS 1.1 version? Shouldn't this be negotiated automatically, as it is by default? Thanks!

that's right, you're right: https://en.wikipedia.org/wiki/Transport_Layer_Security
image

from imagine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.