bernhard Posted October 16, 2021 Share 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! Link to comment Share on other sites More sharing options...
dynweb Posted October 16, 2021 Share 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 Link to comment Share on other sites More sharing options...
bernhard Posted October 16, 2021 Author Share Posted October 16, 2021 Thx, unfortunately that did not work. I also tried verify_peer_name without success.. Link to comment Share on other sites More sharing options...
bernhard Posted October 16, 2021 Author Share 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'); Link to comment Share on other sites More sharing options...
cstevensjr Posted October 16, 2021 Share 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 Link to comment Share on other sites More sharing options...
bernhard Posted October 16, 2021 Author Share Posted October 16, 2021 Thx @cstevensjr! Hm... Maybe a windows issue? @Robin S ? Link to comment Share on other sites More sharing options...
dynweb Posted October 16, 2021 Share 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 Link to comment Share on other sites More sharing options...
horst Posted October 16, 2021 Share 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.) Link to comment Share on other sites More sharing options...
kongondo Posted October 16, 2021 Share Posted October 16, 2021 Windows here, works fine. Link to comment Share on other sites More sharing options...
Rudy Posted October 16, 2021 Share 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 Link to comment Share on other sites More sharing options...
bernhard Posted October 26, 2021 Author Share Posted October 26, 2021 Thx for your help guys. I changed my PHP version on my local laragon and now everything works fine! 1 Link to comment Share on other sites More sharing options...
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