wp-cli: OpenSSL error with `wp package install`

When running wp package install <package>, I get the following error:

Error: The "https://wp-cli.org/package-index/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message digest algorithm
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed

If I use wget or curl on the CLI to fetch that URL, they both work as expected (and they don’t skip verifying the cert), as does fetching the URL in Chrome or Firefox.

Using HTTPie, I get a different error:

http: error: SSLError: [Errno 1] _ssl.c:507: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error

Env: OS X 10.10.3 with OpenSSL 0.9.8zd

wp --info:

PHP binary: /Users/John/.phpbrew/php/php-5.6.12/bin/php
PHP version:    5.6.12
php.ini used:   /Users/John/.phpbrew/php/php-5.6.12/etc/php.ini
WP-CLI root dir:    /Users/John/wp-cli
WP-CLI packages dir:    /Users/John/.wp-cli/packages/
WP-CLI global config:   
WP-CLI project config:  /sites/wp/trunk/wp-cli.yml
WP-CLI version: 0.24.0-alpha

Any suggestions?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 15 (4 by maintainers)

Most upvoted comments

wget http://curl.haxx.se/ca/cacert.pem -O /usr/lib/ssl/cert.pem

and then add this to your php.ini file

openssl.cafile=/usr/lib/ssl/cert.pem

restart your php service

Hello @adampatterson,

Had the same issue than you, then I searched for those stackoverflow posts: first post second post Those worked for me.

In short, MAMP < 4.0.0 OpenSSL version is not compatible with wp-cli package install. I upgraded MAMP to > 4.0.0, now it works fine.

Having this issue as well (OS X 10.10.5, WP-CLI 0.25.0). Did a few things that seemed like I was on the right track but I’m stuck:

  1. Ran brew update && brew upgrade
  2. overrode the existing openssl v.0.9.8 executable with a symlink as specified in this post to version 1.0.2j
  3. Installed wp-cli via brew install wp-cli and changed $PATH to hit that version

All versions seem to be current but I’m still getting the unknown message digest algorithm error. Any clues would be helpful!

I’m having the same issue here.

I try to update OpenSSL and cURL using brew with not success.

Maybe the next details can help.

☁ wcrc wp package install wp-cli/scaffold-package-command
Error: The "https://wp-cli.org/package-index/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:0D0C50A1:asn1 encoding routines:ASN1_item_verify:unknown message digest algorithm
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed

OpenSSL Details

☁  wlcr  openssl version -a
OpenSSL 0.9.8zh 14 Jan 2016
built on: May 15 2016
platform: darwin64-x86_64-llvm
options:  bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) blowfish(idx)
compiler: -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O3 -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DMD32_REG_T=int -DOPENSSL_NO_IDEA -DOPENSSL_PIC -DOPENSSL_THREADS -DZLIB -mmacosx-version-min=10.6
OPENSSLDIR: "/System/Library/OpenSSL"

cURL details

☁  wlcr  curl --version
curl 7.43.0 (x86_64-apple-darwin15.0) libcurl/7.43.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

And finally my Mac details

☁  wlcr  system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: OS X 10.11.6 (15G1004)
      Kernel Version: Darwin 15.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Beau
      User Name: Enrique Chavez (tmeister)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 3 days 18:47