OPTION(rgw_keystone_accepted_roles, OPT_STR, "Member, admin") // roles required to serve requests
OPTION(rgw_keystone_token_cache_size, OPT_INT, 10000) // max number of entries in keystone token cache
OPTION(rgw_keystone_revocation_interval, OPT_INT, 15 * 60) // seconds between tokens revocation check
+OPTION(rgw_keystone_verify_ssl, OPT_BOOL, true) // should we try to verify keystone's ssl
OPTION(rgw_s3_auth_use_rados, OPT_BOOL, true) // should we try to use the internal credentials for s3?
OPTION(rgw_s3_auth_use_keystone, OPT_BOOL, false) // should we try to use keystone for s3?
OPTION(rgw_admin_entry, OPT_STR, "admin") // entry point for which a url is considered an admin request
if (has_send_len) {
curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE, (void *)send_len);
}
+ if (!verify_ssl) {
+ curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L);
+ curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0L);
+ dout(20) << "ssl verification is set to off" << dendl;
+ }
+
CURLcode status = curl_easy_perform(curl_handle);
if (status) {
dout(0) << "curl_easy_perform returned error: " << error_buf << dendl;
string last_method;
string last_url;
+ bool verify_ssl; // Do not validate self signed certificates, default to false
protected:
CephContext *cct;
list<pair<string, string> > headers;
int init_request(const char *method, const char *url, rgw_http_req_data *req_data);
public:
+
static const long HTTP_STATUS_NOSTATUS = 0;
static const long HTTP_STATUS_UNAUTHORIZED = 401;
http_status(HTTP_STATUS_NOSTATUS),
req_data(nullptr),
user_info(nullptr),
+ verify_ssl(true),
cct(_cct) {
}
has_send_len = true;
}
+
long get_http_status() const {
return http_status;
}
+ void set_verify_ssl(bool flag) {
+ verify_ssl = flag;
+ }
+
int process(const char *method, const char *url);
int process(const char *url) { return process("GET", url); }
append_header("X-Auth-Token", admin_token_id);
append_header("Content-Type", "application/json");
+ /* check if we want to verify keystone's ssl certs */
+ set_verify_ssl(cct->_conf->rgw_keystone_verify_ssl);
+
/* encode token */
bufferlist token_buff;
bufferlist token_encoded;
std::string subject_token;
public:
RGWPostHTTPData(CephContext *_cct, bufferlist *_bl) : RGWHTTPClient(_cct), bl(_bl), post_data_index(0) {}
+ RGWPostHTTPData(CephContext *_cct, bufferlist *_bl, bool verify_ssl) : RGWHTTPClient(_cct), bl(_bl), post_data_index(0){
+ set_verify_ssl(verify_ssl);
+ }
void set_post_data(const std::string& _post_data) {
this->post_data = _post_data;
std::string& url)
{
bufferlist bl;
- RGWGetRevokedTokens req(cct, &bl);
+ RGWGetRevokedTokens req(cct, &bl, cct->_conf->rgw_keystone_verify_ssl);
url = cct->_conf->rgw_keystone_url;
if (url.empty()) {
return 0;
}
bufferlist token_bl;
- RGWGetKeystoneAdminToken token_req(cct, &token_bl);
+ RGWGetKeystoneAdminToken token_req(cct, &token_bl, cct->_conf->rgw_keystone_verify_ssl);
token_req.append_header("Content-Type", "application/json");
JSONFormatter jf;
/* can't decode, just go to the keystone server for validation */
- RGWValidateKeystoneToken validate(cct, &bl);
+ RGWValidateKeystoneToken validate(cct, &bl, cct->_conf->rgw_keystone_verify_ssl);
string url = g_conf->rgw_keystone_url;
if (url.empty()) {