summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-certinstall
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-03-24 15:51:31 +0100
committerRob Crittenden <rcritten@redhat.com>2010-04-19 11:27:10 -0400
commit3620135ec97c156b84a310cd423d5df52732b3f8 (patch)
tree665eb48ad333da90acf0313e0005877954e4b9f7 /install/tools/ipa-server-certinstall
parentcc336cf9c17283684df7b850e010d669122126a5 (diff)
downloadfreeipa-3620135ec97c156b84a310cd423d5df52732b3f8.zip
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.gz
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.xz
Use ldap2 instead of legacy LDAP code from v1 in installer scripts.
Diffstat (limited to 'install/tools/ipa-server-certinstall')
-rwxr-xr-xinstall/tools/ipa-server-certinstall18
1 files changed, 8 insertions, 10 deletions
diff --git a/install/tools/ipa-server-certinstall b/install/tools/ipa-server-certinstall
index d02dbbb..d853f71 100755
--- a/install/tools/ipa-server-certinstall
+++ b/install/tools/ipa-server-certinstall
@@ -25,13 +25,13 @@ import tempfile
import traceback
-import krbV, ldap, getpass
+import krbV, getpass
from ipapython.ipautil import user_input
-from ipaserver import ipaldap
from ipaserver.install import certs, dsinstance, httpinstance, installutils
from ipalib import api
+from ipaserver.plugins.ldap2 import ldap2
def get_realm_name():
c = krbV.default_context()
@@ -64,14 +64,12 @@ def parse_options():
return options, args[0]
def set_ds_cert_name(cert_name, dm_password):
- conn = ipaldap.IPAdmin("127.0.0.1")
- conn.simple_bind_s("cn=directory manager", dm_password)
-
- mod = [(ldap.MOD_REPLACE, "nsSSLPersonalitySSL", cert_name)]
-
- conn.modify_s("cn=RSA,cn=encryption,cn=config", mod)
-
- conn.unbind()
+ ldapuri = 'ldap://127.0.0.1'
+ conn = ldap2(shared_instance=False, ldap_uri=ldapuri, base_dn='')
+ conn.connect(bind_dn='cn=directory manager', bind_pw=dm_password)
+ mod = {'nssslpersonalityssl': cert_name}
+ conn.update_entry('cn=RSA,cn=encryption,cn=config', mod)
+ conn.disconnect()
def choose_server_cert(server_certs):
print "Please select the certificate to use:"