diff --git a/barbican/plugin/dogtag.py b/barbican/plugin/dogtag.py index 5401bce15..3d2f68a7c 100644 --- a/barbican/plugin/dogtag.py +++ b/barbican/plugin/dogtag.py @@ -118,10 +118,11 @@ def create_connection(conf, subsystem_path): pem_path = conf.dogtag_plugin.pem_path if pem_path is None: raise ValueError(u._("pem_path is required")) + # port is string type in PKIConnection connection = pki.client.PKIConnection( 'https', conf.dogtag_plugin.dogtag_host, - conf.dogtag_plugin.dogtag_port, + str(conf.dogtag_plugin.dogtag_port), subsystem_path) connection.set_authentication_cert(pem_path) return connection diff --git a/barbican/plugin/dogtag_config_opts.py b/barbican/plugin/dogtag_config_opts.py index 398d210b8..97f48a207 100644 --- a/barbican/plugin/dogtag_config_opts.py +++ b/barbican/plugin/dogtag_config_opts.py @@ -30,9 +30,9 @@ dogtag_plugin_opts = [ cfg.StrOpt('dogtag_host', default="localhost", help=u._('Hostname for the Dogtag instance')), - cfg.StrOpt('dogtag_port', - default="8443", - help=u._('Port for the Dogtag instance')), + cfg.PortOpt('dogtag_port', + default=8443, + help=u._('Port for the Dogtag instance')), cfg.StrOpt('nss_db_path', help=u._('Path to the NSS certificate database')), cfg.StrOpt('nss_password', diff --git a/barbican/tests/plugin/test_dogtag.py b/barbican/tests/plugin/test_dogtag.py index ed9462c97..896bc4b58 100644 --- a/barbican/tests/plugin/test_dogtag.py +++ b/barbican/tests/plugin/test_dogtag.py @@ -286,7 +286,7 @@ class WhenTestingDogtagCAPlugin(utils.BaseTestCase): CONF.dogtag_plugin.ca_host_aid_path = self.host_ca_path CONF.dogtag_plugin.auto_approved_profiles = [self.approved_profile_id] CONF.dogtag_plugin.dogtag_host = "localhost" - CONF.dogtag_plugin.dogtag_port = "8443" + CONF.dogtag_plugin.dogtag_port = 8443 CONF.dogtag_plugin.simple_cmc_profile = "caOtherCert" self.cfg = CONF