Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURL ERROR : SSL certificate problem: unable to get local issuer certificate #1381

Open
VidurK2 opened this issue Jun 22, 2023 · 5 comments
Open
Labels

Comments

@VidurK2
Copy link

VidurK2 commented Jun 22, 2023

I am trying to do composer require phpspreadsheet. However it is giving me this error (upon typing composer diagnose -vvv). I have tried doing everything possible. Please help.

C:\xampp\php>composer diagnose -vvv
Running 2.5.8 (2023-06-09 17:13:21) with PHP 8.2.4 on Windows NT / 10.0
Reading ./composer.json (C:\xampp\php\composer.json)
Loading config file ./composer.json (C:\xampp\php\composer.json)
Checked CA file C:\xampp\php\extras\ssl\cacert.pem: valid
Executing command (C:\xampp\php): git branch -a --no-color --no-abbrev -v
Executing command (C:\xampp\php): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (C:\xampp\php): git log --pretty="%H" -n1 HEAD
Executing command (C:\xampp\php): hg branch
Executing command (C:\xampp\php): fossil branch list
Executing command (C:\xampp\php): fossil tag list
Executing command (C:\xampp\php): svn info --xml
Failed to initialize global composer: Composer could not find the config file: C:/Users/vidur.kaushik/AppData/Roaming/Composer/composer.json

Checking composer.json: Reading ./composer.json (C:\xampp\php\composer.json)
WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
require.wisembly/excelant : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: Executing command (CWD): git config color.ui
No git process found
Checking http connectivity to packagist: Downloading http://repo.packagist.org/packages.json
[200] http://repo.packagist.org/packages.json
OK
Checking https connectivity to packagist: Downloading https://repo.packagist.org/packages.json
FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate
Checking github.com rate limit: Downloading https://api.github.com/rate_limit
FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: unable to get local issuer certificate
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: Downloading https://getcomposer.org/versions
FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: unable to get local issuer certificate
Composer version: 2.5.8
PHP version: 8.2.4
PHP binary path: C:\xampp\php\php.exe
OpenSSL version: OpenSSL 3.0.8 7 Feb 2023
cURL version: 7.85.0 libz 1.2.12 ssl OpenSSL/3.0.8
zip: extension not loaded, unzip not available, 7-Zip present (7z)

@Seldaek
Copy link
Member

Seldaek commented Jun 22, 2023

How have you installed Composer? Because it seems like you have no pubkeys setup, and possibly also a missing CA bundle.. Try reinstalling it from scratch perhaps using the Composer-Setup.exe?

@VidurK2
Copy link
Author

VidurK2 commented Jun 24, 2023

How have you installed Composer? Because it seems like you have no pubkeys setup, and possibly also a missing CA bundle.. Try reinstalling it from scratch perhaps using the Composer-Setup.exe?

All settings correct for using Composer
Downloading...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed
Failed to enable crypto
Failed to open stream: operation failed
Retrying...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed
Failed to enable crypto
Failed to open stream: operation failed
Retrying...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed
Failed to enable crypto
Failed to open stream: operation failed
The download failed repeatedly, aborting.

Im getting this error when i try to php install composer-setup. Even the exe didnt work for me and gave me a certification error

@Seldaek
Copy link
Member

Seldaek commented Jun 24, 2023 via email

@VidurK2
Copy link
Author

VidurK2 commented Jun 26, 2023

Is there an

Then maybe you have some network or machine level firewall that actively messes with ssl connections?

On Sat, Jun 24, 2023, 11:44 Vidur Kaushik @.> wrote: How have you installed Composer? Because it seems like you have no pubkeys setup, and possibly also a missing CA bundle.. Try reinstalling it from scratch perhaps using the Composer-Setup.exe? All settings correct for using Composer Downloading... The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed Failed to enable crypto Failed to open stream: operation failed Retrying... The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed Failed to enable crypto Failed to open stream: operation failed Retrying... The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:0A000086:SSL routines::certificate verify failed Failed to enable crypto Failed to open stream: operation failed The download failed repeatedly, aborting. Im getting this error when i try to php install composer-setup. Even the exe didnt work for me and gave me a certification error — Reply to this email directly, view it on GitHub <#1381 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABM27VI3UEEQ5O5ZHJD3MDXM2ZH5ANCNFSM6AAAAAAZP4NKWM . You are receiving this because you commented.Message ID: @.>

Is there anything i can do to fix that, or someone on an admin level can do? If yes, then how do i describe the issue

@Sicklou
Copy link

Sicklou commented Aug 14, 2023

Hello,

I've got the same issue too with repo.packagist.org : SSL certificate problem: unable to get local issuer certificate with a proxy.

When I launch this command :
curl -x xxxxx.myproxy.com https://repo.packagist.org --cacert C:/DevEnv/SSL/caCert.pem -vvv
the error happened.
But the same command trying to connect to api.github.com is working fine.

And if I try to connect to connect to packagist without the proxy, it works.
But I can't tell composer to avoid using the proxy with packagist, and using it with github.

Here is what I get :

*   Trying 163.116.242.82:8081...
* Connected to xxxxx.myproxy.com (163.116.242.82) port 8081 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to repo.packagist.org:443
> CONNECT repo.packagist.org:443 HTTP/1.1

> Host: repo.packagist.org:443

> User-Agent: curl/7.75.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
* successfully set certificate verify locations:
*  CAfile: C:/DevEnv/SSL/caCert.pem
*  CApath: none
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* CONNECT phase completed!
* CONNECT phase completed!
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2652 bytes data]
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
} [2 bytes data]
* SSL certificate problem: unable to get local issuer certificate

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

If @Seldaek knows something about this ! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants