bernhard Posted October 16, 2021 Posted October 16, 2021 Hi everybody! I'm using the on-demand file downloading feature as shown here: https://processwire.com/blog/posts/pw-3.0.137/#on-demand-mirroring-of-remote-web-server-files-to-your-dev-environment Unfortunately I'm getting the following error in one of my projects: Quote File could not be downloaded (https://.../site/assets/files/.../....jpg) 2: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed, 2: fsockopen(): Failed to enable crypto, 2: fsockopen(): unable to connect to ssl://...:443 (Unknown error) (tried: curl, fopen, socket) The certificate seems to be valid from what I can see in the browser. I have no idea what I could do or how I could debug that ? Any ideas? Thx in advance!
dynweb Posted October 16, 2021 Posted October 16, 2021 You might want to try $http->download($url, $file, ['verify_peer' => false]); Or maybe additional context options: https://www.php.net/manual/en/context.ssl.php 1 1
bernhard Posted October 16, 2021 Author Posted October 16, 2021 Thx, unfortunately that did not work. I also tried verify_peer_name without success..
bernhard Posted October 16, 2021 Author Posted October 16, 2021 Can anybody try if downloading https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png via WireHttp works on their end please? $http = new WireHttp(); $http->download('https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png', __DIR__ . '/tmp.jpg');
cstevensjr Posted October 16, 2021 Posted October 16, 2021 11 minutes ago, bernhard said: Can anybody try if downloading https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png via WireHttp works on their end please? $http = new WireHttp(); $http->download('https://www.baumrock.com/site/assets/files/1192/mockup_mustangs.800x0.png', __DIR__ . '/tmp.jpg'); Works for me 1 1
bernhard Posted October 16, 2021 Author Posted October 16, 2021 Thx @cstevensjr! Hm... Maybe a windows issue? @Robin S ?
dynweb Posted October 16, 2021 Posted October 16, 2021 Download works for me, too. Just in case: Have you checked that you have the correct time on your localhost? That might prevent the cert to validate. 1
horst Posted October 16, 2021 Posted October 16, 2021 It works for me on windows too. (The image file is a PNG with file ending jpg, but the download succeeds without any issue.)
Rudy Posted October 16, 2021 Posted October 16, 2021 @bernhard It might be something to do with your server's root certificate. Have a look at https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ You can check if your root cert has expired or not by checking it here https://www.ssllabs.com/ssltest/ Update: I just ran your domain name and it looks like your DST root cert expired (per Let's Encrypt article above) 3
bernhard Posted October 26, 2021 Author Posted October 26, 2021 Thx for your help guys. I changed my PHP version on my local laragon and now everything works fine! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now