TechZenith

TechZenith: Keeping you informed and inspired by the ever-evolving world of technology.

Follow publication

Member-only story

OpenSSL SSL_connect: SSL_ERROR_SYSCALL

--

The error “OpenSSL SSL_connect: SSL_ERROR_SYSCALL” in cURL usually indicates an issue with SSL/TLS connection between your server and the API. Here’s how you can troubleshoot and fix it.

✅ 1. Test SSL Connection in Terminal

Run this command from your LAMP server to check the SSL certificate of domain.com:

openssl s_client -connect pardarsy.railnet.gov.in:443 -showcerts

Expected Output

  • If it connects successfully, it will show SSL certificate details.
  • If it fails, your server might have outdated SSL libraries or network issues.

✅ 2. Check cURL & OpenSSL Versions

Run:

Ensure You Have

  • OpenSSL 1.1.1 or newer (for modern TLS)
  • cURL 7.58.0 or newer (old versions might not support the API)

If OpenSSL is outdated, update it:

✅ 3. Bypass SSL Verification (For Debugging)

Modify your PHP cURL request to disable SSL verification:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

👉 If this works, the issue is with SSL verification. You should re-enable SSL verification and fix the underlying cause.

✅ 4. Check Server’s CA Certificates

Sometimes, missing CA certificates cause SSL errors.
Run:

ls -l /etc/ssl/certs/ca-certificates.crt

If the file is missing or outdated, update CA certificates:

Then, restart Apache:

sudo systemctl restart apache2

✅ 5. Test API Connection Using wget

If cURL fails, try wget:

wget --no-check-certificate https://xxxx/xxx/loginauth/authenticate
  • If wget works but cURL doesn't, it's likely a cURL/SSL issue.
  • If wget also fails, your server cannot reach the API.

--

--

TechZenith
TechZenith

Published in TechZenith

TechZenith: Keeping you informed and inspired by the ever-evolving world of technology.

www.jyotishgher.in
www.jyotishgher.in

Written by www.jyotishgher.in

Jyotishgher is a premier "Astrology as a Service" startup that redefines how astrology is practiced, learned, and applied. Jyotishgher is your trusted platform.

No responses yet

Write a response