Could Not Open Socket reCAPTCHA Error
Computers & Technology → Site Security
- Author Anthony Chalmers
- Published February 17, 2012
- Word count 594
After months of receiving spam through my contact forms I decided it was time to add reCAPTCHA to them in the hope of stemming the tide of garbage. This now under the control of Google I thought there wasn't going to be an issue with this. Having just installed reCAPTCHA on my works websites I knew what to do and all went well on those sites. On the Friday I did 3 forms on my own sites and all worked as expected, on the Saturday I did the last form I had, but that one didn't work. All I kept getting was a 'could not open socket' error.
Initially I thought I must have made some error in the code but after checking the code against that which I had done the day before I could see no error. And more over the 3 forms I did the day before that worked, now no longer worked and displayed the same error message, what the hell?? Most frustrating was the fact that this was all the message said and gave no clue as to what was causing it. I made a number of attempts to find which section of code that was at fault by adding echo's throughout the php code but none of them showed, only that damned error message. I thought there must be something wrong with the server.
Someone must have had this issue before so I turned my attention to Google for an answer. As I started to type 'could not open socket' the autocomplete came up with 'could not open socket recaptcha', ah ha! But I couldn't think why it could have worked yesterday and not today? After reading many unhelpful posts' I found this: http://code.google.com/p/recaptcha/issues/detail?id=26 which although didn't have the exact answer it did help me to realise the answers to my own issues.
After reading through this thread I came to the conclusion that my problem was 2 fold and explained why it had worked yesterday and not today. The main problem was my web host, in their attempt to be helpful they introduced (a long time back) blocking of outgoing connections to remote IPs from within my sites. This is one to be aware of if you are auto blogging using wp-o-matic, any feed you add will most likely be blocked by this until you add the IP to the allowed list from within your control panel.
I assume there is a good reason for them doing this but it can imagine it has caused nightmares for the inexperienced. Obviously it had worked yesterday because it was new, once the server knew the connection was being made it blocked it. It was probably the number of tests I did that made the connection get noticed and was possibly a good job it was noticed so quickly or I might not have noticed it for some time.
So which IP was I to add to the allowed list? The line of code in recaptchalib.php identified as the problem in the above thread was:
define("RECAPTCHA_VERIFY_SERVER", www.google.com);
So what I needed was the IP of google.com. http://www.mxtoolbox.com/SuperTool.aspx is a very useful tool I have been using for a long time. A DNS lookup for google.com gave me 5 options for an IP, 74.125.227.48 to 74.125.227.52, so now I have:
define("RECAPTCHA_VERIFY_SERVER", "74.125.227.48");
Adding this IP to the allowed remote IP list from within my control panel sorted the problem on all my forms. Score!
Tony has a BSc (Hons) in computing & information technology and manages all sides of IT for two handemade card companies, Vanilla Bloom and Vanilla b. The first specialises in contemporary wedding invitations, while the later are greeting card publishers.
Article source: https://articlebiz.comRate article
Article comments
There are no posted comments.
Related articles
- A Brief Guide: The A-Z of Tailgating Attacks
- Essential Tips for Proofreading and Editing University Assignments
- Stop the Bleeding
- Top 10 Digital Forensics Tools: An In-Depth Exploration
- All You Need To Know To Secure Your Data From Phishing
- Crypto Security Guide: Everything You Need to Know to Protect Your Crypto
- Advancing Email Validation in Laravel
- Fortifying the Digital Fortress: Understanding the Foundations of Cybersecurity Architecture
- How is GenAI Changing Cybersecurity?
- AI-Enhanced Cybersecurity Trends for 2024
- The Game of Trust: A Guide to the Future of KYC in Gaming
- AI in Cybersecurity: The New Frontier in Digital Protection
- Metadata: The Attorney’s Secret Weapon in Civil Litigation
- The importance of cyber security
- 5 Reasons to Comply with CMMC
- Payless CCTV Security Camera
- How Bitdefender Protect From Pegasus Spyware
- Printer Security? Here Are 6 Tips To Keep Your Business Safe
- Why it is important to install Access control system at your business
- Powerful Keyloggers for Windows
- Website security check: Tips on how to protect your website from hackers
- How will cyber threats evolve in 2020?
- When to choose red teaming over penetration testing: A guide to a robust cybersecurity program
- Protect your files with drive image backup software
- How Cloud Management Values Change Your Business
- The U.S. Government and Zero Day Vulnerabilities
- Spyware – Yet Another Cyber Menace
- Reset lost passwords in Windows with Active@ Password Changer
- Antivirus measures you should know when your PC is infected with a virus
- Security Fit For Royalty!