03-07-2012, 05:55 AM
I just set up a secondary server to work with THT and found out that some things went a bit weird with it. The first thing is I didn't think to have it connect to WHM via SSL since I'm not using SSL for my site so we don't have "This site is untrusted" popping up all the time and because PayPal handles all the sensitive data. So, first when you connect to a remote host, you need WHM to be connected to via SSL as set in your security settings. This works for the local server as well.
OK, so here are the bug fig fixes. So you don't have the server wasting resources when it can't connect to the server, we need to set the timout in curl_setopts. We also need to set the SSL verify peer setting to false so that every time we try to pull the XML file from the server to validate if WHM did what we wanted it to, we don't wind up with the error about the certificates not matching up. This even prevents the signup process from working properly as well. Below is how to fix this.
Open /includes/servers/whm.php
Find:
After it, add:
Open /includes/servers/da.php
Find:
After it, add:
OK, so here are the bug fig fixes. So you don't have the server wasting resources when it can't connect to the server, we need to set the timout in curl_setopts. We also need to set the SSL verify peer setting to false so that every time we try to pull the XML file from the server to validate if WHM did what we wanted it to, we don't wind up with the error about the certificates not matching up. This even prevents the signup process from working properly as well. Below is how to fix this.
Open /includes/servers/whm.php
Find:
PHP Code:
curl_setopt($ch, CURLOPT_HTTPHEADER,$curlheaders);
After it, add:
PHP Code:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
Open /includes/servers/da.php
Find:
PHP Code:
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
After it, add:
PHP Code:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
---
See my GitHub at https://github.com/cozylife
See my GitHub at https://github.com/cozylife