0

I'm trying to run this command in WP-CLI: wp package install wp-cli/scaffold-package-command, and I'm getting this error:

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 run openssl version -a

OpenSSL 1.0.2h  3 May 2016
built on: reproducible build, date unspecified
platform: darwin64-x86_64-cc
options:  bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
OPENSSLDIR: "/usr/local/etc/openssl"

Why I'm getting this error? I'm using MAMP on OSX

IAmJulianAcosta
  • 1,082
  • 2
  • 14
  • 30
  • Is the URL `https://downloads.wordpress.org/plugin/...`? If not, then what is it? Please post the output of `openssl s_client -connect :443 -tls1 -servername | openssl x509 -text -noout`. – jww Aug 07 '16 at 16:18
  • [Issue 2918: OpenSSL error with `wp package install](http://github.com/wp-cli/wp-cli/issues/2918). – jww Aug 07 '16 at 16:46

2 Answers2

1

It looks like wp is unable to verify the secure connection to the package storage that it is trying to establish. During verification of the certificate openssl library calls EVP_get_digestbynid() and if it is impossible to find the requested algorithm it generates this error. I suggest doing the following:

Verify that wp uses the correct openssl libraries version. Get the full path of wp utility:

which wp

You will get the path to the executable - something like:

/usr/bin/wp

Next run:

ldd /usr/bin/wp

You will get some output and among it should be similar to those lines:

libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003572800000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003571400000)

Ensure that the executable points to the libraries are in the common place like /usr/lib64 or other but not in some local place where an older version of openssl could be situated.

Oleg
  • 726
  • 5
  • 11
  • 1
    I *think* he may be on OS X. You should probably clarify that since `otool -L` is used on OS X rather than `ldd` on Linux. – jww Aug 07 '16 at 18:30
0

The problem is related to the version of OpenSSL bundled with MAMP, using other PHP worked fine.

Related: Change openssl version in MAMP

Community
  • 1
  • 1
IAmJulianAcosta
  • 1,082
  • 2
  • 14
  • 30