Current time: 05-24-2012, 07:43 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug fix for invalid certificates and timeout issues on remote servers
03-07-2012, 05:55 AM
Post: #1
Bug fix for invalid certificates and timeout issues on remote servers
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:

PHP Code:
curl_setopt($chCURLOPT_HTTPHEADER,$curlheaders); 

After it, add:
PHP Code:
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
                
curl_setopt($chCURLOPT_CONNECTTIMEOUT10);
                
curl_setopt($chCURLOPT_TIMEOUT10); 

Open /includes/servers/da.php
Find:

PHP Code:
curl_setopt($chCURLOPT_RETURNTRANSFER,1); 

After it, add:
PHP Code:
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
                
curl_setopt($chCURLOPT_CONNECTTIMEOUT10);
                
curl_setopt($chCURLOPT_TIMEOUT10); 

---
Enjoy my spiritual blog at http://thelifemaster.com
THT 1.3 Reworked: http://thehostingtool.com/forum/thread-1734.html

Donations are always welcome on my website. Just click the donate button on the bar at the bottom, or the "Help! Yes please do!" button on the menu bar at the top of the site.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-07-2012, 07:56 AM
Post: #2
RE: Bug fix for invalid certificates and timeout issues on remote servers
You're a good asset to THT. Keep up the great work, and thanks to all your contributions.
Find all posts by this user
Quote this message in a reply
03-07-2012, 03:24 PM
Post: #3
RE: Bug fix for invalid certificates and timeout issues on remote servers
Thank you. =)

---
Enjoy my spiritual blog at http://thelifemaster.com
THT 1.3 Reworked: http://thehostingtool.com/forum/thread-1734.html

Donations are always welcome on my website. Just click the donate button on the bar at the bottom, or the "Help! Yes please do!" button on the menu bar at the top of the site.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-08-2012, 10:29 PM (This post was last modified: 03-08-2012 10:31 PM by Kevin.)
Post: #4
RE: Bug fix for invalid certificates and timeout issues on remote servers
PHP Code:
curl_setopt($chCURLOPT_HTTPAUTHCURLAUTH_ANY);
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse); 
These are already in whm.php on line 43 and 44 in the v1.2.3 tag.

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
03-08-2012, 11:52 PM
Post: #5
RE: Bug fix for invalid certificates and timeout issues on remote servers
You're right, they are. I didn't notice that. Its on mine too and I don't know what caused them to get missed and send that error. That's weird. I had it in SSL mode as well. Maybe another option is overriding it? I'm building an automod script right now for THT to drum up some new modders since it'll be easier to mod for, or I'd work on that. If you see anything that looks out of place that could be stopping those from working, please let me know.

---
Enjoy my spiritual blog at http://thelifemaster.com
THT 1.3 Reworked: http://thehostingtool.com/forum/thread-1734.html

Donations are always welcome on my website. Just click the donate button on the bar at the bottom, or the "Help! Yes please do!" button on the menu bar at the top of the site.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)