Oguruma Posted February 26, 2023 Share Posted February 26, 2023 I need to get some data from a third-party server with a Curl call. The problem is I get the 'legacy renegotiation failed" error, since the the third-party server doesn't jive with OpenSSL 3.X. I managed to get data by specifying an alternative OPENSSL_CONF and running the script manually, but I don't know how to specify that file within the script, itself. I made a ssl.conf file in the plugin directory with [openssl_init] ssl_conf = ssl_sect [ssl_sect] system_default = system_default_sect [system_default_sect] Options = UnsafeLegacyRenegotiation And then the call OPENSSL_CONF=ssl.conf php rmls-test.php. The code runs and returns data as expected. The question is, how do I specify the OPENSSL_CONF inside my script? Quote Link to comment https://forums.phpfreaks.com/topic/315950-specify/ Share on other sites More sharing options...
requinix Posted February 26, 2023 Share Posted February 26, 2023 Not entirely sure it is possible. What about downgrading the system openssl to 2.x? Quote Link to comment https://forums.phpfreaks.com/topic/315950-specify/#findComment-1606034 Share on other sites More sharing options...
Oguruma Posted February 26, 2023 Author Share Posted February 26, 2023 Well, 48 minutes ago, requinix said: Not entirely sure it is possible. What about downgrading the system openssl to 2.x? Well downgrading the entire system because of one script seems kind of asinine if I can avoid it... Quote Link to comment https://forums.phpfreaks.com/topic/315950-specify/#findComment-1606035 Share on other sites More sharing options...
kicken Posted February 26, 2023 Share Posted February 26, 2023 You can try using putenv to set OPENSSL_CONF. If that doesn't work and you're need this for a site, you could set the variable in your web server's config (ie, SetEnv for apache). For a CLI script you could create an alias/script and use that to set it. You could check with your script if it's been set and if not abort with an error. Quote Link to comment https://forums.phpfreaks.com/topic/315950-specify/#findComment-1606039 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.