Use the CA chain file from the RPC context

The value can be passed in the create_connection() call but
wasn't used outside that call. It already defaults to
api.env.tls_ca_cert so the context.ca_certfile should be used
instead so the caller can override the cert chain on a
per-connection basis. This may be handy in the future when
there is IPA-to-IPA trust, or for IPA-to-IPA migration.

https://pagure.io/freeipa/issue/7145

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Rob Crittenden
2017-09-06 16:23:03 -04:00
parent 1ec3d54d55
commit 17bda0b1a5

View File

@@ -561,7 +561,7 @@ class SSLTransport(LanguageAwareTransport):
conn = create_https_connection(
host, 443,
api.env.tls_ca_cert,
getattr(context, 'ca_certfile', None),
tls_version_min=api.env.tls_version_min,
tls_version_max=api.env.tls_version_max)