I use wp-cli with wp restful plugin installed.

Running wp cli command wp rest user list --http=https://[url] throws below error:

Error: Failed to get url '[url]': stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
stream_socket_client(): Failed to enable crypto
stream_socket_client(): unable to connect to ssl://[url]:443 (Unknown error).

The website is protected by self-signed certificate. How to cause wp-cli to work with website at https://...?

Is there --insecure or --cacert curl functionality in wp-cli?

Found this post, but found no solution there.

  • As another workaround you could add the self-signed certificate to the machine's CA store.
    – Rup
    Jun 26, 2021 at 10:47
  • Or there's a comment here that you can edit in the -k, but I wouldn't know where.
    – Rup
    Jun 26, 2021 at 10:50


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.