Bobcares

cURL error 7 failed to connect to port 443 – Easy Fix!!

by | Nov 9, 2019

Are you frustrated with “cURL error 7 failed to connect to port 443”? This error is common when using PayPal or Facebook login scripts on the website. This mainly occurs when the server firewall blocks the curl request. Today, let’s discuss the error in detail and see how our Support Engineers fix it for our customers. At Bobcares, we often receive requests to fix this error as part of our Server Management Services.

Overview
  1. What is cURL error 7?
  2. Common Causes Behind the Error
  3. Troubleshooting Tips

What is cURL error 7?

Curl error 7 mainly occurs when the TCP connection to a given host/port fails. It ends up in an error message.

PHP Fatal error: Uncaught exception 'Exception' with message 'cURL error: [7] Failed to connect to xxx.paypal.com port 443: Connection refused'

Let’s discuss the details of the exact scenario of the error.

A Sample Case

Recently, one of our WordPress customers approached us with a request stating:

I have installed a theme on my site, however, the theme won’t validate. I’ve installed a Query Monitor and saw that I’m receiving a cURL 7 error. Could you please help me resolve this issue?

cURL error 7 failed to connect to port 443

On checking the error, our Support engineers ensured that no firewall was blocking outbound connection in this server. Also, we found port 443 opened in TCP In/Out and UDP Out for both IPv4 and IPv6.

How we Fixed It?

Recently when one of our customers ran into this error, our Support Engineers helped them out in no time. Our Support Engineers tried to issue a telnet session to the host server and found some connection errors.

Upon checking, we found that the customer’s IP has been blocked in the WordPress theme update server. And, that is this error was occurring. We asked the customer to contact WordPress to whitelist the IP in their firewall. This resolved the error and the theme activation worked fine.

Common Causes Behind the Error

Now. let’s take a look at some of the common causes behind this error:

1. PayPal script: In case we are using PayPal on our website, our experts recommend taking a closer look. One way to check if the PayPal script is the root cause behind the error would be to remove the script and check if the error persists.

2. Facebook login script: In some cases, the error is due to the server firewall blocking the curl request. Additionally, this also results in a blocked IP address preventing the validation of a theme after installation. We are likely to run into this error when the curl request is not on the standard port.

3. Server Unreachable: There may be a network problem or the server may be unavailable.

4. Firewall or Security Software: Outgoing connections on port 443 may be blocked by firewalls, antivirus programs, or other security software.

5. DNS Resolution Problems: It’s possible that the domain name isn’t correctly resolving to an IP address.

6. Network Configuration: Incorrect client-side network configuration might obstruct a connection.

7. Proxy Settings: The connection attempt may fail if a proxy is needed but is not set up correctly or if there are proxy-related problems.

8. SSL/TLS Configuration: Although they often result in distinct cURL error codes, issues with SSL/TLS configuration can also lead to connection failures.

Troubleshooting Tips

Here are a few troubleshooting tips to avoid cURL error 7:

1. Upgrade the PHP to the latest version.

2. Then, disable all plugins and activate them one at a time to check when the error pops up.

3. Alternatively, we can switch back to the default WordPress theme and check if the error still appears or not.

4. Check if the server is up using tools like ping, traceroute, or websites like “Is It Down Right Now.”

5. Ensure the internet connection is active by accessing other websites or services.

6. Check if the firewall or security software is blocking connections on port 443. Temporarily disable them to test.

7. Use nslookup or dig to ensure the domain resolves correctly:

nslookup example.com
dig example.com

8. Verify the network settings for any misconfigurations or restrictions.

9. If using a proxy, configure cURL to use it:

curl -x http://proxyserver:port https://example.com

If not using a proxy, ensure no proxy settings are set:

curl --noproxy '*' https://example.com

10. Ensure SSL/TLS settings are correct. To debug, we can disable SSL verification:

curl -k https://example.com

[Need more help to solve this error?- We’re available 24/7 to help you.]

Conclusion

In short, cURL error 7 failed to connect to port 443 mainly occurs when the firewall blocks the curl request. Today, we have discussed this error in detail and saw how our Support Engineers fix it for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

10 Comments

    • Sijin George

      Hello Haresh,
      Can you please use the secure link in your code? If you still have the error, our Experts can help, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
  1. Marv

    The REST API request failed due to an error.
    Error: cURL error 7: Failed to connect to webcheap.ca port 443: Connection timed out (http_request_failed)

    Reply
    • Maheen Aboobakkar

      Hello Marv,

      Please ensure that the IP is not blocked in the firewall. We’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
  2. Andriy

    Thank you, the problem was in a firewall.

    Reply
    • Syam S

      You are welcome

      Reply
  3. Rajath

    Error:WP HTTP Error: cURL error 7: Failed to connect to http://www.axx.com port 443: Connection refused

    Reply
    • Hiba Razak

      Hi Rajath,
      Please contact our support team through live chat (click on the icon at right-bottom).

      Reply
  4. Shailesh J Chawda

    Hello, I have one webportal in php in where I displayed list of accounts using Grandstream API. I have multiple ips are there, but only one ip is working and display data. Rest are giving me error. My site is hosted in hostinger.

    Error: Failed to connect to 50.229.121.235 port 7443 after 72 ms: Connection refused

    Reply
    • Hiba Razak

      Hi Shailesh,
      Please contact our support team via live chat(click on the icon at right-bottom).

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF