diff --git a/etc/metadata_agent.ini b/etc/metadata_agent.ini index 38909233e7..c2f59cd283 100644 --- a/etc/metadata_agent.ini +++ b/etc/metadata_agent.ini @@ -5,6 +5,10 @@ # The Neutron user information for accessing the Neutron API. auth_url = http://localhost:5000/v2.0 auth_region = RegionOne +# Turn off verification of the certificate for ssl +# auth_insecure = False +# Certificate Authority public key (CA cert) file for ssl +# auth_ca_cert = admin_tenant_name = %SERVICE_TENANT_NAME% admin_user = %SERVICE_USER% admin_password = %SERVICE_PASSWORD% diff --git a/neutron/agent/metadata/agent.py b/neutron/agent/metadata/agent.py index 40dae1e609..47352abf29 100644 --- a/neutron/agent/metadata/agent.py +++ b/neutron/agent/metadata/agent.py @@ -61,6 +61,14 @@ class MetadataProxyHandler(object): help=_("The type of authentication to use")), cfg.StrOpt('auth_region', help=_("Authentication region")), + cfg.BoolOpt('auth_insecure', + default=False, + help=_("Turn off verification of the certificate for" + " ssl")), + cfg.StrOpt('auth_ca_cert', + default=None, + help=_("Certificate Authority public key (CA cert) " + "file for ssl")), cfg.StrOpt('endpoint_type', default='adminURL', help=_("Network service endpoint type to pull from " @@ -89,6 +97,8 @@ class MetadataProxyHandler(object): auth_strategy=self.conf.auth_strategy, region_name=self.conf.auth_region, token=self.auth_info.get('auth_token'), + insecure=self.conf.auth_insecure, + ca_cert=self.conf.auth_ca_cert, endpoint_url=self.auth_info.get('endpoint_url'), endpoint_type=self.conf.endpoint_type ) diff --git a/neutron/tests/unit/test_metadata_agent.py b/neutron/tests/unit/test_metadata_agent.py index b1ef07f1b7..8a56b62a93 100644 --- a/neutron/tests/unit/test_metadata_agent.py +++ b/neutron/tests/unit/test_metadata_agent.py @@ -34,6 +34,8 @@ class FakeConf(object): auth_url = 'http://127.0.0.1' auth_strategy = 'keystone' auth_region = 'region' + auth_insecure = False + auth_ca_cert = None endpoint_type = 'adminURL' nova_metadata_ip = '9.9.9.9' nova_metadata_port = 8775 @@ -100,6 +102,8 @@ class TestMetadataProxyHandler(base.BaseTestCase): password=FakeConf.admin_password, auth_strategy=FakeConf.auth_strategy, token=None, + insecure=FakeConf.auth_insecure, + ca_cert=FakeConf.auth_ca_cert, endpoint_url=None, endpoint_type=FakeConf.endpoint_type) ]