jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
531 stars 230 forks source link

--client-cert-path option doesn't work #1173

Open EslamElHusseiny opened 3 years ago

EslamElHusseiny commented 3 years ago

Describe the bug Using --client-cert-path option in jfrog rt rc command returns the following error [Error] Failed loading client certificate: open : no such file or directory To Reproduce run the following command JFROG_CLI_LOG_LEVEL=DEBUG jfrog rt rc --server-id <server-id> --client-cert-path server.pem --url <Artifactory URL> template.json

Expected behavior The requested repo to be created and jfrog CLI to connect to the Artifactory instance using the certificate provided.

Versions

Additional context I had to use jfrog rt curl --cacert server.pem ... instead as a workaround and my curl command got executed successfully with a few warnings

[Warn] Attempt 0 - Failure occurred while sending GET request to https://<URL>/artifactory/api/system/version - Get "https://<URL>/artifactory/api/system/version": x509: certificate signed by unknown authority
[Warn] Attempt 1 - Failure occurred while sending GET request to https://<URL>/artifactory/api/system/version - Get "https://<URL>/artifactory/api/system/version": x509: certificate signed by unknown authority
[Warn] Attempt 2 - Failure occurred while sending GET request to https://<URL>/artifactory/api/system/version - Get "https://<URL>/artifactory/api/system/version": x509: certificate signed by unknown authority
[Warn] Attempt 3 - Failure occurred while sending GET request to https://<URL>/artifactory/api/system/version - Get "https://<URL>/artifactory/api/system/version": x509: certificate signed by unknown authority
Or-Geva commented 2 years ago

Thanks for reporting this, @EslamElHusseiny. According to your description, it appears that you are also missing --client-cert-key-path. I will change the error message to make it more clear.

oallauddin commented 1 year ago

Is this still an outstanding bug? The cert file exists, does not require a key and is in PEM format.
But I am getting an error that the file does not exist.

cert-path