services:
- rgw
with_legacy: true
+- name: rgw_crypt_vault_ssl_clientcert
+ type: str
+ level: advanced
+ desc: Path for custom client certificate for accessing vault server
+ services:
+ - rgw
+ with_legacy: true
+- name: rgw_crypt_vault_ssl_clientkey
+ type: str
+ level: advanced
+ desc: Path for private key required for client cert
+ services:
+ - rgw
+ with_legacy: true
- name: rgw_crypt_kmip_addr
type: str
level: advanced
curl_easy_setopt(easy_handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(easy_handle, CURLOPT_SSL_VERIFYHOST, 0L);
dout(20) << "ssl verification is set to off" << dendl;
- } else if (!ca_path.empty()) {
- curl_easy_setopt(easy_handle, CURLOPT_CAINFO, ca_path.c_str());
- dout(20) << "using custom ca cert "<< ca_path.c_str() << " for ssl" << dendl;
+ } else {
+ if (!ca_path.empty()) {
+ curl_easy_setopt(easy_handle, CURLOPT_CAINFO, ca_path.c_str());
+ dout(20) << "using custom ca cert "<< ca_path.c_str() << " for ssl" << dendl;
+ }
+ if (!client_cert.empty()) {
+ if (!client_key.empty()) {
+ curl_easy_setopt(easy_handle, CURLOPT_SSLCERT, client_cert.c_str());
+ curl_easy_setopt(easy_handle, CURLOPT_SSLKEY, client_key.c_str());
+ dout(20) << "using custom client cert " << client_cert.c_str()
+ << " and private key " << client_key.c_str() << dendl;
+ } else {
+ dout(5) << "private key is missing for client certificate" << dendl;
+ }
+ }
}
curl_easy_setopt(easy_handle, CURLOPT_PRIVATE, (void *)req_data);
curl_easy_setopt(easy_handle, CURLOPT_TIMEOUT, req_timeout);
string ca_path;
+ string client_cert;
+
+ string client_key;
+
std::atomic<unsigned> stopped { 0 };
void set_ca_path(const string& _ca_path) {
ca_path = _ca_path;
}
+
+ void set_client_cert(const string& _client_cert) {
+ client_cert = _client_cert;
+ }
+
+ void set_client_key(const string& _client_key) {
+ client_key = _client_key;
+ }
};
secret_req.set_ca_path(cct->_conf->rgw_crypt_vault_ssl_cacert);
}
+ if (!cct->_conf->rgw_crypt_vault_ssl_clientcert.empty()) {
+ secret_req.set_client_cert(cct->_conf->rgw_crypt_vault_ssl_clientcert);
+ }
+ if (!cct->_conf->rgw_crypt_vault_ssl_clientkey.empty()) {
+ secret_req.set_client_key(cct->_conf->rgw_crypt_vault_ssl_clientkey);
+ }
+
res = secret_req.process(null_yield);
if (res < 0) {
ldout(cct, 0) << "ERROR: Request to Vault failed with error " << res << dendl;