Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gbryant200's avatar

Curl 35 Error using Composer

I'm receiving this curl 35 error when I use Composer to create a new laravel/laravel project. It fails when trying to connect to the github api.

results of some troubleshooting, we have proxy server and a corporate firewall. Curl works fine with other https sites that are allowed by the proxy and firewall. Github is on the approved list.

Connected to (nil) (XX.XXX.XX.XX) port 3128 (#0)

allocate connect buffer! Establish HTTP proxy tunnel to github.com:443 CONNECT github.com:443 HTTP/1.1 Host: github.com:443 User-Agent: curl/7.81.0 Proxy-Connection: Keep-Alive

< HTTP/1.1 200 Connection established <

Proxy replied 200 to CONNECT request CONNECT phase completed! ALPN, offering h2 ALPN, offering http/1.1 CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs TLSv1.0 (OUT), TLS header, Certificate Status (22): TLSv1.3 (OUT), TLS handshake, Client hello (1): TLSv1.0 (OUT), TLS header, Unknown (21): TLSv1.3 (OUT), TLS alert, decode error (562): error:0A000126:SSL routines::unexpected eof while reading Closing connection 0 curl: (35) error:0A000126:SSL routines::unexpected eof while reading

Any help would be greatly appreciated.

Ubuntu 22.04.3 LTS Curl version 7.81.0 Composer version 2.6.6

0 likes
8 replies
LaryAI's avatar
Level 58

It seems like you're encountering an SSL handshake error when trying to use Composer through a proxy server and a corporate firewall. This can be a tricky issue to resolve, but here are some steps you can take to troubleshoot and potentially fix the problem:

  1. Update cURL and OpenSSL: Ensure that you have the latest versions of cURL and OpenSSL installed, as older versions might not support the necessary protocols or ciphers required by GitHub.

  2. Configure Composer to Use the Proxy: If you haven't already, you should configure Composer to use your proxy server. You can do this by setting the http_proxy and https_proxy environment variables:

    export http_proxy=http://proxy.server:port
    export https_proxy=http://proxy.server:port
    

    Replace proxy.server and port with your actual proxy server's address and port number. You can also add these lines to your .bashrc or .bash_profile to make the change permanent.

  3. Check SSL/TLS Versions: Some corporate firewalls or proxy servers may restrict the SSL/TLS versions that can be used. Make sure that the versions allowed by your proxy and firewall are compatible with what GitHub requires.

  4. Verify CA Certificates: The error message indicates that there might be an issue with the CA certificates. Ensure that the CA certificates on your system are up to date. You can update them with the following command:

    sudo update-ca-certificates
    
  5. Try Using the --with-all-dependencies Option: Sometimes, using the --with-all-dependencies option with Composer can help resolve connection issues:

    composer create-project laravel/laravel your-project-name --with-all-dependencies
    
  6. Use the -vvv Option for Verbose Output: Running Composer with the -vvv option can give you more detailed output, which might help identify the issue:

    composer create-project laravel/laravel your-project-name -vvv
    
  7. Check for Firewall/Proxy Restrictions: Double-check with your IT department to ensure that there are no additional restrictions on your firewall or proxy that could be causing the issue.

  8. Test with cURL Directly: Try connecting to GitHub's API using cURL directly to see if you can replicate the issue outside of Composer:

    curl -v https://api.github.com -x http://proxy.server:port
    

    Replace proxy.server and port with your actual proxy server's address and port number. This can help you determine if the issue is with Composer or with the proxy/firewall settings.

If none of these steps resolve the issue, it might be helpful to reach out to Composer's support or check GitHub's status to see if there are any ongoing issues that could be affecting your connection.

gych's avatar

Which version of nginx are you using?

gbryant200's avatar

I'm just trying to git clone / curl from github.com. I'm convinced it's a problem with our proxy server. It's a squid proxy server that I don't have access to. I'll have to find a work around or get corporate to see what's going on.

Thanks for the reply though.

gbryant200's avatar

gych - thanks for the suggestions.

The github openssl issue appears to be exactly what I'm experiencing. I added the:

[system_default_sect] Options = SSL_OP_IGNORE_UNEXPECTED_EOF

to my openssl.cnf file and set the OPENSSL_CONF path to point to the cnf file. It didn't appear to do anything.

I guess maybe I need to recompile OpenSSl with that option.

Thanks again.

gych's avatar

@gbryant200 Hey, I'm wondering if you managed to solve the issues you were having?

gbryant200's avatar

No. Everything works fine as long as I don't use our corporate proxy (Squid Proxy). I found a bug report on GitHub regarding my very issue. So far, the corporate security people haven't done anything to resolve the issue.

Thanks for checking in.

1 like

Please or to participate in this conversation.